Professional Documents
Culture Documents
NAME
Bushra Batool (170811)
Bachelors of Electrical Engineering
(BEET-6-A)
Lab Engineer
SIR TOUSEEF
Designation
FACULTY OF ENGINEERING
QPSK:
Quadrature Phase Shift Keying (QPSK) is a form of Phase Shift Keying in which two bits are
modulated at once, selecting one of four possible carrier phase shifts (0, 90, 180, or 270 degrees).
QPSK allows the signal to carry twice as much information as ordinary PSK using the same
bandwidth. QPSK is used for satellite transmission of MPEG2 video, cable modems,
videoconferencing, cellular phone systems, and other forms of digital communication over an RF
carrier.
QPSK MODULATION:
The QPSK Modulator uses a bit-splitter, two multipliers with local oscillator, a 2-bit serial to
parallel converter, and a summer circuit. Following is the block diagram for the same.At the
modulator’s input, the message signal’s even bits (i.e., 2nd bit, 4th bit, 6th bit, etc.) and odd bits
(i.e., 1st bit, 3rd bit, 5th bit, etc.) are separated by the bits splitter and are multiplied with the
same carrier to generate odd BPSK (called as PSKI) and even BPSK (called as PSKQ).
The PSKQ signal is anyhow phase shifted by 90° before being modulated.
The QPSK waveform for two-bits input is as follows, which shows the modulated result for
different instances of binary inputs.
QPSK DE-MODULATION:
The QPSK Demodulator uses two product demodulator circuits with local oscillator, two band
pass filters, two integrator circuits, and a 2-bit parallel to serial converter. Following is the
diagram for the same.The two product detectors at the input of demodulator simultaneously
demodulate the two BPSK signals. The pair of bits are recovered here from the original data.
These signals after processing, are passed to the parallel to serial converter.
APPLICATION:
It is most robust modulation technique due to the fact that binary 1 and 0 are separated by
180 degree phase shift of the carrier.
Due to this property, BPSK modulated data can travel longer distances when transmitted
from base station or subscriber stations
MATLAB CODE:
Message signal:
%qpsk modulation
clc;
clear all;
close all
T=1;
t=0:(T/100):T;
c1=sqrt(2/T)*cos(2*pi*1*t);
c2=sqrt(2/T)*sin(2*pi*1*t);
N=8;
x=randi([0 1],1,N);
x=2*x-1; %conveting them in to pNRZ
even_seq=x(1:2:length(x));
odd_seq=x(2:2:length(x));
t1=0;
t2=1
i=1;
m_s=2:2:length(x);
t_s=0:0.01:length(x);
for j=1:length(t_s)
if t_s(j)<=m_s(i)
even_ps(j)=even_seq(i); %pluse shaping up to 2tb
else
even_ps(j)=even_seq(i);
i=i+1;
end
end
i=1;
m_s=2:2:length(x);
for j=1:length(t_s)
if t_s(j)<=m_s(i)
odd_ps(j)=odd_seq(i);
else
odd_ps(j)=odd_seq(i);
i=i+1;
end
end
for i=1:2:(N-1)
t=[t1:(T/100):t2]
if x(i)>0.5
x(i)=1;
m=ones(1,length(t));
else
x(i)=0;
m=-1*ones(1,length(t));
end
x_odd(i,:)=c1.*m;
if x(i+1)>0.5
x(i+1)=1;
m=ones(1,length(t));
else
x(i+1)=0;
m=-1*ones(1,length(t));
end
even_x(i,:)=c2.*m;
qpsk=x_odd+even_x;
%plot(t,qpsk(i,:));
%title('QPSK xnal');
%hold on
t1=t1+(1+.01);
t2=t2+(1+.01);
end
%hold off
figure();
stem(x);
title('Original xnal');
Orthogonal carriers:
yy=[];
y=0
x=randi([0 1],1,N);
for i=1:2:length(x)
if x(i)==0 && x(i+1)==0
y=cosd(255)+1j*sind(255);
elseif x(i)==0 && x(i+1)==1
y=cosd(135)+1j*sind(135);
elseif x(i)==1 && x(i+1)==0
y=cosd(315)+1j*sind(315)
elseif x(i)==1 && x(i+1)==1
y=cosd(45)+1j*sind(45);
end
yy=[yy y];
end
ber_simu=[];
M=4;
scatterplot(yy)
for EbN0dB= 0:15;
EbN0=10^(EbN0dB/10);
n=(1/sqrt(2))*(randn(1,length(yy))+(1j*randn(1,length(yy))));
sigma=sqrt(1/(log2(M)*EbN0));
r=yy+sigma*n;
scatterplot(r)
I=(real(r)>0);
q=(imag(r)>0);
x_cap=[];
for i=1:length(r)
x_cap=[x_cap I(i) q(i)];
end
%ber
ber_sim=sum(x~= x_cap)/N;
ber_simu=[ber_simu ber_sim];
end
EbN0dB=0:15;
semilogy(EbN0dB,ber_simu,'R-')
CONSTELLATION DIAGRAM:
CALCULATING THE BER FOR DIFFERENT VALUE OF BER: