You are on page 1of 7

RIZAL TECHNOLOGICAL UNIVERSITY

Boni Avenue, Mandaluyong City

College of Engineering and Industrial Technology


Electronics and Communications Engineering
and Technology Department

DIGITAL COMMUNICATIONS LECTURE


CEIT-05-803P/TF/7:30A-9:00A

Differential Phase Shift Keying


(MATLAB)

Submitted by:

Cellona, Kim V.
Santos, Teena Marie A.
La Guardia, Joy Christine

Submitted to:

Engr. Jenny Aruta

APRIL 4, 2018
DIFFERENTIAL PHASE SHIFT KEYING

MODULATION AND DEMODULATION

Differential Phase Shift Keying (DPSK) the phase of the modulated signal is
shifted relative to the previous signal element. No reference signal is
considered here. The signal phase follows the high or low state of the
previous element. This DPSK technique doesn’t need a reference oscillator.

It is seen from the above figure that, if the data bit is Low i.e., 0, then
the phase of the signal is not reversed, but continued as it was. If the data
is a High i.e., 1, then the phase of the signal is reversed, as with NRZI,
invert on 1 (a form of differential encoding).

If we observe the above waveform, we can say that the High state represents
an M in the modulating signal and the Low state represents a W in the
modulating signal.

DPSK Modulator

DPSK is a technique of BPSK, in which there is no reference phase signal. Here,


the transmitted signal itself can be used as a reference signal. Following is
the diagram of DPSK Modulator.
DPSK encodes two distinct signals, i.e., the carrier and the modulating
signal with 180° phase shift each. The serial data input is given to the XNOR
gate and the output is again fed back to the other input through 1-bit delay.
The output of the XNOR gate along with the carrier signal is given to the
balance modulator, to produce the DPSK modulated signal.

DPSK Demodulator
In DPSK demodulator, the phase of the reversed bit is compared with the phase
of the previous bit. Following is the block diagram of DPSK demodulator.

From the above figure, it is evident that the balance modulator is given the
DPSK signal along with 1-bit delay input. That signal is made to confine to
lower frequencies with the help of LPF. Then it is passed to a shaper
circuit, which is a comparator or a Schmitt trigger circuit, to recover the
original binary data as the output.
Differential Phase Shift Keying Modulation
Mathlab M-File
SYNTAX y = dpskmod(x,M)
y = dpskmod(x,M,phaserot)
y = dpskmod(x,M,phaserot,symbol_order
DESCRIPTION
y = dpskmod(x,M) outputs the complex envelope y of the modulation of
the message signal x using differential phase shift keying
modulation. M is the alphabet size and must be an integer. The message
signal must consist of integers between 0 and M-1. If x is a matrix
with multiple rows and columns, the function processes the columns
independently.
y = dpskmod(x,M,phaserot) specifies the phase rotation of the
modulation in radians. In this case, the total phase shift per symbol
is the sum of phaserot and the phase generated by the differential
modulation.
y = dpskmod(x,M,phaserot,symbol_order) specifies how the function
assigns binary words to corresponding integers. If symbol_order is set
to 'bin' (default), the function uses a natural binary-coded ordering.
If symbol_order is set to 'gray', it uses a Gray-coded ordering.

Example 1.1
>>clear all

>>M = 4; % Generate a sequence of 4-ary random symbols.


>>x = randi([0 M-1],500,1); % Apply DQPSK modulation to the input symbols.
>>y = dpskmod(x,M,pi/8); % Create a constellation diagram object and set
its properties to display.
>>h=comm.ConstellationDiagram
('ShowTrajectory',true,
'ShowReferenceConstellation',
false); % a signal trajectory diagram and to disable
the display of the reference constellation.
>>step(h,y) % Use the |step| function to display the
trajectory.
‘A constellation graph’
Representation of Constellation Diagram of Example 1.1
Differential Phase Shift Keying De-Modulation
Mathlab M-File
SYNTAX
z = dpskdemod(y,M)
z = dpskdemod(y,M,phaserot)
z = dpskdemod(y,M,phaserot,symbol_order)

DESCRIPTION

z = dpskdemod(y,M) demodulates the complex envelope y of a DPSK modulated


signal. M is the alphabet size and must be an integer. If y is a matrix with
multiple rows and columns, the function processes the columns independently.

Note: An initial phase rotation of 0 is used in determining the first


element of the output z, or the first row of z, if z is a matrix with
multiple rows, because the differential algorithm compares two successive
elements of the modulated signal.

z = dpskdemod(y,M,phaserot) specifies the phase rotation of the modulation


in radians. In this case, the total phase shift per symbol is the sum
of phaserot and the phase generated by the differential modulation.

z = dpskdemod(y,M,phaserot,symbol_order) specifies how the function


assigns binary words to corresponding integers. If symbol_order is set
to 'bin' (default), the function uses a natural binary-coded ordering.
If symbol_order is set to 'gray', it uses a Gray-coded ordering.

Example 2.1
This example shows how to demodulate DPSK data in a communication channel in
which a phase shift is introduced.

>> rng default % Set the random number generator


to the default state for
repeatability.
>> M = 4; % Generate a 4-ary data vector and
modulate using DPSK.
>> dataIn = randi([0 M-1],1000,1); % Random message
>> txSig = dpskmod(dataIn,M); % Modulate
>> rxSig = txSig*exp(2i*pi*rand()); % Apply the random phase shift
resulting from the transmission
process.
>> dataOut = dpskdemod(rxSig,M); % Demodulate the received signal.

As the modulator and demodulator have the same initial condition while only
the received signal experiences a phase shift, the first demodulated symbol
is likely to be in error. Because of this, you should always discard the
first symbol when using DPSK.
>> errs = symerr(dataIn,dataOut) % Find the number of symbol errors.
>> errs = symerr(dataIn(2:end),
dataIn(2:end)) % Observe that there is one symbol
in error. Repeat the error
calculation after discarding the
first symbol.

>>h=comm.ConstellationDiagram
('ShowTrajectory',true,
'ShowReferenceConstellation',
false);

>>step(h,dataOut)

You might also like