Вы находитесь на странице: 1из 6

MUSHTAQ AHMAD DAR 2019PEE0032

DIGITAL COMMUNICATION
EXPERIMENT NO: - 04
AIM: -To Determine the Error Performance of QPSK & 4-ASK Modulation Techniques in AWGN
Channel.

REQUIREMENTS: - Computer with MATLAB software


THEORY: -
4-Amplitude Shift Keying (ASK): -
In a 4-ASK system the received signal can be written as:
r=x+n
where x ∈ {-3d, −d, d, 3d}, n ∼ CN (0, σ2) and σ2 = N0. The real part of the above equation is
r = x+ nr where n ∼ N (0, σ2/2) = N (0, N0/2). In 4-ASK constellation dmin =2sqrt (Eb) and Eb/N0
is called SNR per bit. Probability of error for 4-ASK is
Pe=1.5*erfc (sqrt (0.8*SNR));

Source Code for Probability of Error of 4-ASK: -


clc;
clear all;
D=1;
d=randn(1,10000);
snr=1:1:10; %%snr in dB
W=length(snr)
%SNR=10.^(snr./10);
for snrdb=1:W
SNR=10.^(snrdb./10) ;
ps=1/sqrt(2*SNR)
for i=1:4
A(i)=D*(2*i-1-4);
scatter(A(i),0)
hold on
end

counter_1=0;
for i=1:10000
s(i)=A(1)+ps*d(i);
if(s(i)>-2)
counter_1=counter_1+1;
end
end
k=randn(1,10000);
scatter(s,k);
hold on
counter_2=0;
MUSHTAQ AHMAD DAR 2019PEE0032

for j=1:10000

t(j)=A(2)+ps*d(j);
if(t(j)<-2)||(t(j)>0)
counter_2=counter_2+1;
end
end
k=randn(1,10000);
scatter(t,k);
hold on
counter_3=0;
for m=1:10000
u(m)=A(3)+ps*d(m);
if(u(m)<0)||(u(m)>2)
counter_3=counter_3+1;
end
end
k=randn(1,10000);
scatter(u,k);
hold on
counter_4=0;
for n=1:10000
v(n)=A(4)+ps*d(n);
if(v(n)<2)
counter_4=counter_4+1;
end
end
k=randn(1,10000);
scatter(v,k);
hold on
Pe(snrdb)=0.25*(counter_1/10000+counter_2/10000+counter_3/10000+counter_4/100
00);
end
figure;
semilogy(snr,Pe,'G*-');
hold on;
M=10.^(snr./10);
f=sqrt(2*M);
p=1.5*qfunc(f);
semilogy(snr,p);
xlabel('snrdb');
ylabel('prob of error');
title('probability of error of 4-ASK')
MUSHTAQ AHMAD DAR 2019PEE0032

RESULT: -

Quadrature Phase Shift Keying(QPSK): -

QPSK stands for Quadrature Phase Shift Keying. It is digital modulation technique. QPSK is
bandwidth efficient as each signal point represents two bits.
Instead of a phase shift of 180 degree, as allowed in BPSK, a common encoding technique, known
as QPSK uses phase shifts of multiples of 90 degrees
QPSK modulation can be represented mathematically as mentioned below.
S(t)= A* cos(2*pi*fc*t + pi/4) for '11' input bits
S(t)= A *cos(2*pi*fc*t + (3*pi4)/4) for '01' input bits
S(t)= A *cos(2*pi*fc*t -(3*pi4)/4) for '00' input bits
S(t)= A *cos(2*pi*fc*t -pi/4) for '10' input bits
MUSHTAQ AHMAD DAR 2019PEE0032

Figure demonstrates the QPSK Modulation concept.

It converts two binary bits represented simultaneously at the input to the complex signal S(t) or d as
mentioned. This complex signal selects one of the four phases based on two binary digits. Each state
of the complex signal or waveform is called as symbol.

For QPSK, input bit stream needs to break up to two-two bits and later these two bits are entered
simultaneously to the input of the QPSK modulator. Hence, as shown in the constellation diagram for
the input of 11 the output is (1+j*1) *KMOD, where KMOD is normalization factor. For most of the
systems KMOD is 0.707
As mentioned this output of 0.707+j*0.707 is called as symbol which represent two binary
information digits.
MUSHTAQ AHMAD DAR 2019PEE0032

Source Code for Probability of Error of 4-QPSK: -


clc;
clear all;
Snr=1:1:14;
for snr=1:1:14
SNR=10.^(snr/10);
power=1./sqrt(SNR);
n=normrnd(0,power,[1,10000]);
for k=1:1:4

x(k)=cos(2*pi*(k-1)/4+pi/4);
y(k)=sin(2*pi*(k-1)/4+pi/4);
z(k)=x(k)+i*y(k);
end

counter_1=0;

for j=1:10000
s(j)=z(1)+n(j);
theta=angle(s(j));
if theta>0&&theta<1.5700
counter_1=counter_1+1;
end
end
counter_2=0;
for j=1:10000
s(j)=z(2)+n(j);
theta=angle(s(j));
if theta<3.14 && theta>1.5700
counter_2= counter_2+1;
end
end
counter_3=0;
for j=1:10000
s(j)=z(3)+n(j);
theta=angle(s(j));
if theta>-3.14 && theta<-1.5700
counter_3=counter_3+1;
end
end
counter_4=0;
for j=1:10000
s(j)=z(4)+n(j);
theta=angle(s(j));
if theta>-1.5700 && theta<0
counter_4=counter_4+1;

end
end
Pe(snr)=1-(((counter_1+counter_2+counter_3+counter_4))*(1/40000));
end
figure;
semilogy(Snr,Pe,'G*-');
hold on;
snrdb1=1:1:14;
MUSHTAQ AHMAD DAR 2019PEE0032

snr1=10.^(snrdb1/10);
pp=qfunc(sqrt(snr1./2));
semilogy(snrdb1,pp);
grid;
xlabel('snrdb');
ylabel('prob of error');
title('probability of error of psk');
legend('Simulation ','Analytical')

RESULT: -

Вам также может понравиться