Main Content


Modulate using M-ary DPSK method


The comm.DPSKModulator object modulates a signal using the M-ary differential phase shift keying method. The output is a baseband representation of the modulated signal.

To modulate a signal using differential phase shift keying:

  1. Create the comm.DPSKModulator object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?




dpskmod = comm.DPSKModulator creates a modulator System object™ that modulates the input signal using the M-ary differential phase shift keying (M-DPSK) method.

dpskmod = comm.DPSKModulator(Name=Value) sets Properties using one or more name-value arguments.

dpskmod = comm.DPSKModulator(M,phase,Name=Value) creates an M-DPSK modulator object that has the ModulationOrder property set to M, the PhaseRotation property set to phase, and optional name-value arguments.


expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Number of points in the signal constellation, specified as a positive integer.

Data Types: double

Additional phase shift between the previous and current modulated symbols in radians, specified as a scalar. This value corresponds to the phase difference between the previous and current modulated symbols when the input is zero.

Data Types: double

Option to input data as bits, specified as a numeric or logical 0 (false) or 1 (true).

  • When you set this property to false, the input to the System object requires a column vector of integer symbol values in the range [0, (M – 1)], where M represents the value of the ModulationOrder property.

  • When you set this property to true, the input must be a column vector of bit values whose length is an integer multiple of log2(ModulationOrder). This vector contains bit representations of integers in the range [0, (M – 1)].

Data Types: logical

Constellation encoding, specified as "Gray" or "Binary". This property controls how the object maps an integer or a group of log2(ModulationOrder) input bits to the corresponding modulated signal.

  • When you set this property to "Gray", the object uses a Gray-encoded signal constellation.

  • When you set this property to "Binary", the input integer L in the range [0, (M – 1)] shifts the output phase. M represents the value of ModulationOrder. This shift is (ϕ + 2×π×L / M) radians from the previous output phase. ϕ is the value of the PhaseRotation property. The output symbol is exp(j×ϕ + j×2×π×L / M)× (previously modulated symbol).


This property applies when you set the BitInput property to true.

Data type of output, specified as "double" or "single".



Y = dpskmod(X) returns the modulated DPSK baseband signal.

Input Arguments

expand all

Input data, specified as an integer or column vector of integers or bits with numeric or logical data types.

The setting of the BitInput property determines the interpretation of the input data.


To process an input signal as binary elements, set the BitInput property to 'true'. For binary inputs, the number of rows must be an integer multiple of log2(M). The function maps groups of log2(M) bits onto a symbol, with the first bit representing the MSB and the last bit representing the LSB.

Output Arguments

expand all

DPSK-modulated baseband signal, returned as a column vector.

Complex Number Support: Yes

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:


expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object


collapse all

Create a DPSK modulator and demodulator pair.

bps = 3;   % Bits per symbol
M = 2^bps; % Modulation order  
dpskmod = comm.DPSKModulator(M,pi/8,BitInput=true);
dpskdemod = comm.DPSKDemodulator(M,pi/8,BitOutput=true);

Create an error rate calculator. Set the ComputationDelay property to 1 to account for the one bit transient caused by the differential modulation.

errorRate = comm.ErrorRate(ComputationDelay=1);

Run a loop processing frames of data that consists of these main steps:

  1. Generate data frames of 150 3-bit symbols.

  2. 8-DPSK-modulate the data.

  3. Filter the data through an AWGN channel.

  4. 8-DPSK-demodulate the data.

  5. Collect error statistics.

numframes = 100; % Number of frames
spf = 150;       % Symbols per frame
snr = convertSNR(10,"ebno","snr",BitsPerSymbol=3);
for counter = 1:numframes
    txData = randi([0 1],spf,1);
    modSig = dpskmod(txData);
    rxSig = awgn(modSig,snr,'measured');
    rxData = dpskdemod(rxSig);
    errorStats = errorRate(txData,rxData);

Display the error statistics.

ber = errorStats(1)
ber = 0.0098
numErrors = errorStats(2)
numErrors = 147
numBits = errorStats(3)
numBits = 14999


This object implements the algorithm, inputs, and outputs described on the M-DPSK Modulator Baseband block reference page. The object properties correspond to the block parameters.

Extended Capabilities

Version History

Introduced in R2012a