Main Content


Demodulate using MSK method and Viterbi algorithm


The comm.MSKDemodulator System object™ demodulates a signal that was modulated using the differentially encoded minimum shift keying method. The object expects the input signal to be a baseband representation of a coherent modulated signal with no precoding. For more information, see Algorithms.

To demodulate a signal that was modulated using minimum shift keying:

  1. Create the comm.MSKDemodulator 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?




mskdemod = comm.MSKDemodulator creates a demodulator System object, mskdemod. This object demodulates the input minimum shift keying (MSK) modulated data using the Viterbi algorithm.


mskdemod = comm.MSKDemodulator(Name=Value) sets Properties using one or more name-value arguments. For example, InitialPhaseOffset=pi/2 specifies an initial phase of pi/2 radians for the input modulated waveform.


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.

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

  • When you set this property to false, output Y is an N/SamplesPerSymbol long column vector. N represents the length of the input signal, which is the number of input baseband modulated symbols. The vector elements are -1 or 1.

  • When you set this property to true, output Y is a binary column vector with a length equal to N/SamplesPerSymbol. The vector elements are bit values of 0 or 1.

Data Types: logical

Initial phase offset of the input modulated waveform in radians, specified as a numeric scalar.

Number of samples per input symbol, specified as a positive integer.

Data Types: double

Number of trellis branches that the Viterbi algorithm uses to construct each traceback path, specified as a positive integer. The value of this property is also the output delay. This value indicates the number of zero symbols that precede the first meaningful demodulated symbol in the output.

Data Types: double

Data type of the output, specified as 'double', 'int8', 'int16', 'int32', or 'logical'.

  • When you set the BitOutput property to false, you can set the output data type to 'double', 'int8', 'int16', or 'int32'.

  • When you set the BitOutput property to true, you can set the output data type to 'double' or 'logical'.



Y = mskdemod(X) applies MSK demodulation to the input signal and returns the demodulated signal.

Input Arguments

expand all

MSK-modulated signal, specified as a scalar or column vector.

This object accepts variable-size inputs. After the object is locked, you can change the size of each input channel, but you cannot change the number of channels. For more information, see Variable-Size Signal Support with System Objects.

Data Types: double | single
Complex Number Support: Yes

Output Arguments

expand all

Output signal, returned as a scalar or column vector. To specify whether the object outputs values as integers or bits, use the BitOutput property. The output data type is determined by the OutputDataType property.

Data Types: double | logical | int8 | int16 | int32

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 an MSK modulator and an MSK demodulator. Use a phase offset of π/4.

 mskmod = comm.MSKModulator(BitInput=true, ...
    mskdemod = comm.MSKDemodulator(BitOutput=true, ...

Create an error rate calculator. Account for the delay caused by the Viterbi algorithm.

    ber = comm.ErrorRate('ReceiveDelay',mskdemod.TracebackDepth);
    for counter = 1:100

Transmit 100 3-bit words through an AWGN channel, using a signal-to-noise ratio of 0.

      data = randi([0 1],300,1);
      modSignal = mskmod(data);
      noisySignal = awgn(modSignal,0);
      receivedData = mskdemod(noisySignal);
      errorStats = ber(data, receivedData);
    fprintf('Error rate = %f\nNumber of errors = %d\n', ...
      errorStats(1), errorStats(2))
Error rate = 0.000067
Number of errors = 2


Differentially encoded minimum shift keying modulation uses pulse shaping to smooth the phase transitions of the modulated signal. The function q(t) is the phase response obtained from the frequency pulse, g(t), through this relation:q(t)=tg(t)dt.

The specified frequency pulse shape corresponds to this rectangular pulse shape expression for g(t).

Pulse ShapeExpression

  • L is the main lobe pulse duration in symbol intervals.

  • The duration of the pulse, LT, is the pulse length in symbol intervals.

Extended Capabilities

Version History

Introduced in R2012a

expand all