Skip to Main Content Skip to Search
Product Documentation

dpskdemod - Differential phase shift keying demodulation

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.

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.

Examples

The example below illustrates the fact that the first output symbol of a differential PSK demodulator is an initial condition rather than useful information.

% Example on DPSKMOD and DPSKDEMOD ref pgs.

% Copyright 2003 - 2011 The MathWorks, Inc.
% $Revision: 1.1.8.2 $ $Date: 2011/09/03 18:55:57 $

close all;

% FIRST EXAMPLE
% begindocexample dqpsk
s = RandStream.create('mt19937ar', 'seed',131);
prevStream = RandStream.setGlobalStream(s); % seed for repeatability
M = 4; % Use DQPSK in this example, so M is 4.
x = randi([0 M-1],500,1); % Random data
y = dpskmod(x,M,pi/8); % Modulate using a nonzero initial phase.
plot(y) % Plot all points, using lines to connect them.
% enddocexample dqpsk
RandStream.setGlobalStream(prevStream); % restore default stream
doctouchupfigure(gcf,.8);

% NEXT EXAMPLE
s = RandStream.create('mt19937ar', 'seed',131);
prevStream = RandStream.setGlobalStream(s); % seed for repeatability

% begindocexample dpskdemod
M = 4; % Alphabet size
x = randi([0 M-1],1000,1); % Random message
y = dpskmod(x,M); % Modulate.
z = dpskdemod(y,M); % Demodulate.
% Check whether the demodulator recovered the message.
s1 = symerr(x,z) % Expect one symbol error, namely, the first symbol.
s2 = symerr(x(2:end),z(2:end)) % Ignoring 1st symbol, expect no errors.
% enddocexample dpskdemod
RandStream.setGlobalStream(prevStream); % restore default stream

The output is below.

s1 =

     1


s2 =

     0

For another example that uses this function, see Example: Curve Fitting for an Error Rate Plot.

See Also

dpskmod | pskdemod | pskmod

How To

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS