QPSK Mod&Demodwith Noise
QPSK Mod&Demodwith Noise
QPSK Mod&Demodwith Noise
On
QUADRATURE PHASE SHIFT KEYING MODULATION AND
DEMODULATION
Submitted as a part of
ANALOG COMMUNICATIONS
Submitted by
S. No. Roll No. Name of the Student
1 17311A04P2 ARUN KUMAR
2 17311A04P3 T.MANASWINI PATEL
3 17311A04P5 JAIESH REDDY
(Signature)
• ABSTRACT
• INTRODUCTION
• EQUIPMENTS
• CODE
• BLOCK DIAGRM
• WORKING
• RESULTS
• REFERENCE
http://www.gaussianwaves.com/2010/10/qpsk-modulation-and-
demodulation-2
https://www.caeaccess.org/archives/volume2/number3/378-1692
ABSTRACT
Quadrature Phase Shift Keying (QPSK) is a modulation scheme commonly used in
wireless communication system and it's because of its ability to transmit twice the
data rate for a given bandwidth. In most cases, the QPSK modulator consumes less
power and bandwidth in a modern devices but for a system like satellite and
mobile devices where their operations are power limited, this is a problem that
needs to be fixed. The objective is to design the QPSK modulator that uses less
power for operation and it should be bandwidth efficient. The proposed technique
uses data stored inside a memory block to produce a symbol according to the given
input data. The QPSK modulation process requires a Direct Digital Synthesizer
(DDS) to produce sine and cosine wave which are used as carrier signal with the
data signal to produce QPSK/BPSK output signal. The proposed modulator
successfully modeled with Verilog Hardware Description Language (HDL),
simulated with Xilinx Integrated Software Environment (ISE) version 14. 5
software. QPSK modulation is also performed on MATLAB tool, which gives
three types of waveforms. 1) In-phase component, 2) Quadrature phase, and 3)
Composite of both. After that the QPSK demodulator has been developed using
MATLAB tool in order to verify the functionality of the modulator.
Traditionally, local communication was done over wires, as this presented a cost-
effective way of ensuring a reliable transfer of information. However, for long-
distance communications, transmission of information over radio waves was
needed. Although this was convenient from a hardware standpoint, radio-waves
transmission raised doubts about the corruption of the information; transmission
was often dependent on high-power transmitters to overcome weather conditions,
large buildings, and interference from other sources of electromagnetics.
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-phasearm) are converted toNRZ formatin 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.
QPSK Demodulation:
For QPSK demodulator , a coherent demodulator is taken as an example. In
coherent detection technique the knowledge of the carrier frequency and phase
must be known to the receiver. This can be achieved by using a PLL (phase lock
loop) at the receiver. A PLL essentially locks to the incoming carrier frequency
and tracks the variations in frequency and phase. For the following simulation , a
PLL is not used but instead we simple use the output of the PLL.
For demonstration purposes we simply assume that the carrier phase recovery is
done and simply use the generated reference frequencies at the receiver (cos(ωt))
and (sin(ωt)).
EQUIPMENTS:
MATLAB SOFTWARE
yd=((60./pw.^5).*(t-5e-9).*exp(-(t-5e-9).^2./pw.^2)-(80./pw.^7).*(t-5e-
9).^3.*exp(-(t-5e-9).^2./pw.^2)+ ...
(16.*(t-5e-9).^5./pw.^9.*exp(-(t-5e-9).^2/pw.^2)));%(one) fifth derivative pulse
delayed by 5e-9 sec
%================================================
%NOISE SETUP FOR BER AND SNR
%================================================
%================================================
%DPSK
%================================================
%The following series of equations sets the pulse recurring frequency(PRF)
%at 200MHz(waveform repeats every 5e-9 sec and a
%modulated bit stream(bit rate=200Mb/s)of 1001101 (differentially encoded to a
value of 01110110)
%where a phase change (0to1 or 1to0)=0 and no phase change (0to0 or 1to1)=1
%==================================================
% FIFTH DERIVATIVE(DPSK) WITH 5 PULSES)
%==================================================
yc=ydelayed.*ydiff;
%yc=ydiff.*ydelayed;%This is where the correlation occurs in the receiver and
would be the
%mixer in the receiver. You are multipling the DPSK fifth with a .5e-9 delayed
replecia
%==================================================
% FFT
%==================================================
%new FFT for DPSK modulated fifth(ydiff)
NFFYDIFF=2.^(ceil(log(length(ydiff))/log(2)));
FFTYDIFF=fft(ydiff,NFFYDIFF);%pad with zeros
NumUniquePts=ceil((NFFYDIFF+1)/2);
FFTYDIFF=FFTYDIFF(1:NumUniquePts);
MYDIFF=abs(FFTYDIFF);
MYDIFF=MYDIFF*2;
MYDIFF(1)=MYDIFF(1)/2;
MYDIFF(length(MYDIFF))=MYDIFF(length(MYDIFF))/2;
MYDIFF=MYDIFF/length(ydiff);
f=(0:NumUniquePts-1)*2*Fn/NFFYDIFF;
%===================================================
% PLOTS
%===================================================
%plots for DPSK modulated fifth(ydiff)
figure(1)
subplot(2,2,1); plot(t,ydiff);xlabel('TIME');ylabel('AMPLITUDE');
title('DPSK modulated pulse train(01110110)');
grid on;
%axis([-1e-9,27e-9 -1 2]);
subplot(2,2,2); plot(f,MYDIFF);xlabel('FREQUENCY');ylabel('AMPLITUDE');
grid on;
%axis([0 20e9 0 .0001]);%zoom in/out
subplot(2,2,3); plot(t,ydelayed);xlabel('TIME');ylabel('AMPLITUDE');
title('DPSK delayed pulse train(01110110)');
grid on;
%axis([-1e-9,27e-9 -1 2]);
subplot(2,2,4);
plot(f,20*log10(MYDIFF));xlabel('FREQUENCY');ylabel('20LOG10=DB');
grid on;
%axis([0 15e9 -200 5]);
%=========================================================
==
%CORRELATION RECEIVER COMPARATOR[ADC](before lowpass filter)
%=========================================================
==
pt=.1e-8%sets level where threshhold device comparator triggers
H=5;%(volts)
L=0;%(volts)
LEN=length(yc);
for ii=1:LEN;
if yc(ii)>=pt;%correlated output(yc) going above pt threshold setting
pv(ii)=H;%pulse voltage
else;
pv(ii)=L;
end;
end ;
po=pv;%pulse out=pulse voltage
%figure(3)
subplot(2,2,4);plot(t,po);
axis([-1e-9 27e-9 -1 6])
title('Comparator output');xlabel('FREQUENCY');ylabel('VOLTAGE');
grid on;
%===================================================
%SETUP and INFO
%===================================================
%Check axis settings on plots.
%Change t=-1e-9:1/Fs:(xxxx) to 1e-9 or proper value for viewing
%Press F5 or run.
%With waveform in plot 2,2,1(Figure 1), set pulse width to
%.5e-9(tail to tail).
%Change t=-1e-9:1/Fs:(xxx) to something like 46e-9.Zoom out. I would
%comment in all plot axis and use them for zooming in and out.
%Press F5 and observe waveforms. Print or observe waveforms to compare with
next set of
%wave forms.
%=========================================================
==========
% CORRELATION RECEIVER LOW PASS FILTER(INTEGRATOR)
%=========================================================
==============
rc=.5e-9;%time constant
ht=(1/rc).*exp(-t/rc);%impulse response
ycfo=filter(yc,1,ht)/Fs;%use this instead of ycfo=conv(yc,ht)/Fs for proper
dimension.
%The #=1 allows this. The LPF RC time constant(integrates over this time).
%Theory states that it should be set to the pulse width but should be set
%to a value that gives the best error free operation at the highest noise
%levels. Different filter types(butterworth,etc) may give different
%results.
%The 3DB or 1/2 power bandwidth on the RC LPF is f=1/(2*pi*RC). The noise
%bandwith is f=1/(4*rc).
yn=filter(noise,1,ht)/Fs;%looks at filtered noise only(Figure 4)
%=========================================================
% CORRELATION RECEIVER COMPARATOR[ADC](after low pass filter)
%=========================================================
pt1=1.7e-8%sets level where threshhold device comparator triggers
H=5;%(volts)
L=0;%(volts)
LEN=length(ycfo);
for ii=1:LEN;
if ycfo(ii)>=pt1;%correlated output(ycfo) going above pt threshold setting
pv1(ii)=H;%pulse voltage
else;
pv1(ii)=L;
end;
end ;
po1=pv1;%pulse out=pulse voltage
subplot(2,2,4);plot(t,po1);xlabel('FREQUENCY');ylabel('VOLTAGE');
axis([-1e-9 50e-9 -1 6]);
title('Comparator output (filtered) 1001101');
grid on;
%=========================================================
%BER CALCULATIONS
%=========================================================
%I'm going to calibrate the noise generator and roughly determine the Eb/No or
SNR in DB
%that allows the system to operate almost error free(1e-3) in a noise environment.
%This value of Eb/No is the number in DB that can be used in link
%calculations. The calibration is required because in an actual TX-RX the received
%voltage into the correlation receiver at the mixer will be in the low millivolt
%region due to the FCC spectral mask at -41.3dBm/MHz and low transmitter
power.
%It will not be the 2 volt peak-peak BPSK used here and must be recalibrated if
%different than 2 volt peak-peak.
%I did some preliminary link caculations with this set up and determined that
approx 0.6mv p-p
%would be present on the mixer input at Eb/No=9DB.
%========================================================
%FCC spectral mask -41.3dBm/MHz+10LOG10(~4000)=~-5dBm(aver TX power
Pt)
%antenna gains 0DBi(50 ohms)
%lna 20DB gain
%NF 10 DB
%distance 1 meter
%(PL)path loss~45DB
%200Mbit rate(Rb)
%BW~318Mhz 3DB BW(LPF)(RC=.5e-9)
%Pn(receiver noise level)=KTB=-114dBm+NF+10log10(Rb)=-
114dBm+10DB+23DB=-81dBm
%3DB to 10DB spread of pulse ~3 to 6GHz(use 4GHz)
%pw=.5e-9 fifth derevative
%fc=~7Ghz
%Eb/No=9DB(1e-3)
%power received(Pr)@ant=-5dBm-45DB(PL)=-50dBm over ~4GHz.
%Link margin=Pr-Pn-Eb/No
%Link margin@ 1 meter=-50dBm-(-81dBm)-(9DB)=22DB
%Emixerp-p=sqrt(1e-5mw*50)=2.23e-
2mvrms*1.41=0.03mvpeak*20DB(lna)gain=0.3mvpeak or 0.6mvp-p
THEORY &PROOFS:
Taking the above concept of PSK a stage further, it can be assumed that the
number of phase shifts is not limited to only two states. The transmitted "carrier"
can undergo any number of phase changes and,by multiplying the received signal
by a sine wave of equal frequency, will demodulate the phase shifts into
frequency-independent voltage levels.This is indeed the case in quadraphase-shift
keying (QPSK). With QPSK, the carrier undergoes four changes in phase (four
symbols) and can thus represent 2 binary bits of data per symbol. Although this
may seem insignificant initially, a modulation scheme has now been supposed that
enables a carrier to transmit 2 bits of information instead of 1, thus effectively
doubling the bandwidth of the carrier.The proof of how phase modulation, and
hence QPSK, is demodulated is shown below. The proof begins by defining Euler's
relations, from which all the trigonometric identities can be derived.
From Equation 1, it can be seen that multiplying two sine waves together
(one sine is the incoming signal, the other is the local oscillator at the
Which gives an output frequency (sin 2ωt) double that of the input, with no DC
offset.It is now fair to make the assumption that multiplying sin ωt by any phase-
shifted sine wave (sin ωt + ø)yields a "demodulated" waveform with an output
frequency double that of the input frequency, whose DC offset varies according to
the phase shift, ø.
To prove this:
Thus, the above proves the supposition that the phase shift on a carrier can
be demodulated into a varying output voltage by multiplying the carrier with
a sine-wave local oscillator and filtering out the high-frequency term.
Unfortunately, the phase shift is limited to two quadrants; a phase shift of
π/2cannot be distinguished from a phase shift of -π/2. Therefore, to
accurately decode phase shifts present in all four quadrants, the input signal
needs to be multiplied by both sinusoidal and cosinusoidal waveforms, the
high frequency filtered out, and the data reconstructed. The proof of this,
expanding on the above mathematics, is shown below.
Thus:
A SPICE simulation verifies the above theory. Figure 1 shows a block diagram of
a simple demodulator circuit. The input voltage, QPSK IN, is a 1MHz sine wave
whose phase is shifted by 45°, 135°, 225°, and then 315° every 5μs.
Figures 2 and 3 show the "in-phase" waveform, VI, and the "quadrature"
waveform, VQ, respectively.Both have a frequency of 2MHz with a DC offset
proportional to the phase shift, confirming the above mathematics.
Figure 4 is the phasor diagram showing the phase shift of QPSK IN and the
demodulated data.
The above theory is perfectly acceptable, and it would appear that removing the
data from the carrier is a simple process of lowpass filtering the output of the mixer
and reconstructing the four voltages back into logic levels. In practice, getting a
receiver local oscillator exactly synchronized with the incoming signal is not easy.
If the local oscillator varies in phase with the incoming signal, the signals on the
phasor diagram will undergo a phase rotation with its magnitude directly
proportional to the phase difference. Moreover, if the phase and frequency of the
local oscillator are not fixed with respect to the incoming signal, there will be a
continuing rotation on the phasor diagram. Therefore, the output of the front-end
demodulator is normally fed into an ADC and any rotation resulting from errors in
the phase or frequency of the local oscillator are removed in DSP.An effective way
of converting directly to baseband is using a direct-conversion tuner IC.The above
devices are part of the rapidly expanding RF chipsets from Maxim Integrated
Products. With five high-speed processes, more than 70 high-frequency standard
products, and 52 ASICs in development, Maxim is committed to being a major
player in the RF/wireless, fiber/cable, and instrumentation markets.
BLOCKDIAGRAM:
QPSK Modulator
QPSK demodulator
Fig.1 Shows constellation view of QPSK signal showing 4 possible phase i.e. 45°, 135°, 225°
and 315°. Each symbol contains 2 bit as shown in above figure.
QPSK signal is generated using a binary bit stream; this stream is then given into
demultiplexer which then gives two outputs
(Fig 2)
.
These outputs from demultiplexer undergo NRZ coding and get shifted by pi/2
phase shift and are finally added to give QPSK signal.
It is called quadrature because of two carrier wave that are out of phase with each
other by 90° (Fig 3) .Thus after modulation, the signal that we get varies by both
amplitude and phase. As shown in fig 3. I and Q inputs individually are mixed with
out of phase waves and then are finally added to give output QAM signal.
DIGITAL MODULATION TECHNIQUES
In digital modulation the modulated signal is a digital signal. It can be said as
digital to analog conversion method. Various digital modulation schemes are:
A. ASK
In ASK (Amplitude shift key) amplitude of the carrier wave is varied in
accordance with the modulating signal. As shown in figure 4 a digital data
1011010 is to be transmitted which is represented by a modulating signal, after
modulating carrier signal according to the data given an ASK modulated signal is
generated.
Fig.3 shows block diagram of QAM modulation technique. I and Q inputs individually are mixed
with out of phase waves and then are finally added to give output QAM
B. FSK
Fig.4 Shows ASK modulation technique in which a digital data 1011010 is to be transmitted
using ASK modulation
Fig.5 shows FSK modulation technique. A digital data 1011010 is to be transmitted using FSK
modulation
C. PSK
In PSK (Phase shift key) phase of the carrier wave is varied in accordance with the
modulating signal. Figure 6 shows a signal 1011010 and a carrier signal which
after modulation gives a PSK modulated signal. A PSK further includes QPSK,
BPSK and DPSK techniques.
Fig.6 Shows PSK modulation technique. A digital data 1011010 and a carrier signal which after
modulation gives a PSK modulated signal.
RESULT:
FIGURE-1
REFERENCE:
http://www.gaussianwaves.com/2010/10/qpsk-modulation-and-
demodulation-2
https://www.caeaccess.org/archives/volume2/number3/378-1692
www.pudn.com