You are on page 1of 6

SCHEMATIC DIAGRAM

QPSK Digital Modulation Simulation Using MATLAB:


Quadrature Phase Shift Keying
Quadrature Phase Shift Keying (QPSK) is one of the type of phase shift keying. Unlike BPSK
which send one bit information at an instance, QPSK is a modulation which sends two bits of
digital information a time (without the use of another carrier frequency). They both are by the
wayDSBCS modulation scheme.

In a sense, QPSK is an expanded version from binary PSK where in a symbol consists of two bits
and two orthonormal basis functions are used. A group of two bits is often called a 'dibit'. So, four
dibits are possible. Each symbol carries same energy.

The above was just in introduction about what QPSK is, search over the internet to get more stuffs
about it. You will get number of learning resources which explains you the A-Z of the theoretical
aspect of it.

The process which we have followed while implementing on MATLAB is quite conventional.
First: get the bit stream.
Then Divide the bit stream in 2 bit streams: even & odd.
Then apply the BPSK techniques on these 2 bit streams separately.
Add the modulated waves to get the QPSK.

Another way to implement it in MATLAB or any other simulation software would be, to introduce
a phase shift of 90 degree, on each pair of bit change. For more information just search Maxim
Integrated QPSK tutorial, here you will get all the relevant equation information.
MATLAB Code For QPSK :

clc;
clear all;
close all;
cvx=input('Enter Length of Random Bit Sequence:');
d=round(rand(1,cvx))
l=cvx;
x=0:0.01:l*2*pi;
cc=cos(x);
cs=cos(x+pi/2);
k=length(cc);
k1=k/l;
for i=1:l
if(d(i)==0)
d(i)=-1;
i=i+1;
end
end
i=1;
j=1;% To segrigate odd bit streams and even bit streams
while (i<l) && (j<l) %half strem with double symbol duration
dd1(j)=d(i);
dd1(j+1)=d(i);
dd2(j)=d(i+1);
dd2(j+1)=d(i+1);
j=j+2;
i=i+2;
end% to make bit streams cycle equivalent to sinusoidal waveformt=1;
for i=1:l
for j=1:k1 %k1 sample with 1 sine period
dd(t)=d(i);
d1(t)=dd1(i);
d2(t)=dd2(i);
t=t+1;
j=j+1;
end
i=i+1;
end

subplot(6,1,1);
stairs(dd);
axis([0 t -2 2]);
title('Imput Bit Stream');
subplot(6,1,2);
stairs(d1);
axis([0 t -2 2]);
title('Odd Bit Stream');
subplot(6,1,3);
stairs(d2);
axis([0 t -2 2]);
title('Even Bit Stream');ngth(d1);
if(k<len)
len=k;
end

for i=1:len
qcc(i)=cc(i)*d1(i);% odd streams multiplied with I waveform
qcs(i)=cs(i)*d2(i);% even streams multiplied with Q waveform
i=i+1;
end

subplot(6,1,4);
plot(qcc);
axis([0 len -2 2]);
title('Modulated Wave of I-Component');
subplot(6,1,5);
plot(qcs);
axis([0 len -2 2]);
title('Modulated Wave of Q-Component');

qp=qcc+qcs; % QPSK output from Adder


subplot(6,1,6);
plot(qp);
axis([0 len -2 2]);
title('QPSK WAVEFORM');
figure, scatter(dd1,dd2,40,'*r');
title('Constellation Diagram of QPSK');

RESULTS:
MATHEMATICAL EQUATION :

QPSK Modulation: In digital modulation techniques a set of basis functions are chosen for a particular
modulation scheme.Generally the basis functions are orthogonal to each other. Basis functions can be
derived using ‘Gram Schmidt orthogonalization’ procedure.Once the basis function are chosen, any
vector in the signal space can be represented as a linear combination of the basis functions. In
Quadrature Phase Shift Keying (QPSK) two sinusoids (sin and cos) are taken as basis functions for
modulation. Modulation is achieved by varying the phase of the basis functions depending on the
message symbols. In QPSK, modulation is symbol based,where one symbol contains 2 bits. The following
equation outlines QPSK modulation technique.

si(t)=2EsT−−−−√cos(2πfct+(2n−1)π4),n=1,2,3,4

When n=1, the phase shift is 45 degrees. This is called pi/4 QPSK.The constellation diagram of QPSK will
show the constellation points lying on both x and y axes.This means that the QPSK modulated signal will
have an in-phase component (I) and also a quadrature component (Q). This is because it has only two
basis functions. A QPSK modulator can be implemented as follows. A demultiplexer (or serial to parallel
converter) is used to separate odd and even bits from the generated information bits. Each of the odd
bits (quadrature arm) and even bits (in-phase arm) are converted to NRZ format in a parallel manner.
The signal on the in-phase arm is multiplied by cosine component and the signal on the quadrature arm
is multiplied by sine component. QPSK modulated signal is obtained by adding the signal from both in-
phase and quadrature arm.
BLOCK DIAGRAM AND ITS DESCRIPTION:

I. Standard QPSK Simulation

The Simulink model of QPSK modulator and demodulator is shown below

 Build the Simulink model shown in Figure 1.


 Double-click on the Random Integer Generator and adjust the set size to a
proper value (Remember that the input to the QPSK modulator should be either
0, 1, 2, or 3).
 In the Random Integer Generator block, set the Sample Time to 1e-6 (i.e. 1 µs)
and the Samples per frame parameter to 1024.
 In the AWGN block, set the Symbol period parameter to 1e-6 (i.e. 1 µs) and
the Number of bits per symbol parameter to 2 (since QPSK uses 2 bits per
symbol).
 For the Error Rate Calculation block, set the Output data field to “port” so you can
connect the Display block.
 The Display Block will show you three values. The first value is the BER, the
second value is the number of incorrect bits, and the third value is the total
number of bits received.
 Set the simulation time to 10 seconds.
 In both QPSK Modulator and Demodulator blocks, set the Constellation
ordering to Gray. Take a note of the constellation points.
 In this experiment, you will adjust the value of the in the AWGN block, starting
from 3, incrementing by 1 every step, and ending at 15, and observe the error
rate displayed in the Display block. Make a table recording the value of and the
corresponding BER.
 Plot BER vs. and compare with the theoretical values. Comment on the results.
 Repeat for Binary Constellation ordering in both QPSK modulator and
demodulator blocks and comment on the results.

REFERENCES:

 https://www.researchgate.net/publication/224611110_Short-
Range_Ultrasonic_Communications_in_Air_Using_Quadrature_Modulatio
n

 http://www.idc-
online.com/technical_references/pdfs/electronic_engineering/QPSK_mod
ulation_and_Demodulation.pdf

 http://www.divilabs.com/2015/02/qpsk-digital-modulation-
simulation.html?m=1

 http://ecelabs.njit.edu/ece489v2/lab4.php

You might also like