Demodulate using MSK method and Viterbi algorithm
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:
comm.MSKDemodulatorobject and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
demodulator System object,
mskdemod = comm.MSKDemodulator
mskdemod. This object demodulates the input minimum
shift keying (MSK) modulated data using the Viterbi algorithm.
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.
BitOutput — Output data as bits
false (default) |
Option to provide output in bits, specified as a numeric or logical
When you set this property to
false, the object method outputs a column vector with a length equal to N/
SamplesPerSymbol. N represents the length of the input signal, which is the number of input baseband modulated symbols. The vector elements are
When you set this property to
true, the object method outputs a binary column vector with a length equal to N/
SamplesPerSymbol. The vector elements are bit values of
InitialPhaseOffset — Initial phase offset
0 (default) | numeric scalar
Initial phase offset of the input modulated waveform in radians, specified as a numeric scalar.
SamplesPerSymbol — Number of samples per input symbol
8 (default) | positive integer
Number of samples per input symbol, specified as a positive integer.
TracebackDepth — Traceback depth for Viterbi algorithm
16 (default) | positive integer
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.
OutputDataType — Data type of output
"double" (default) |
Data type of output, specified as:
doublewhen you set the
BitOutputproperty to false.
logicalwhen you set the
BitOutputproperty to true.
x — MSK-modulated signal
scalar | column vector
MSK-modulated signal, specified as a scalar or column vector.
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
Demodulate MSK Signals with Bit Inputs and Phase Offset
Create an MSK modulator and an MSK demodulator. Use a phase offset of .
mskmod = comm.MSKModulator(BitInput=true, ... InitialPhaseOffset=pi/4); mskdemod = comm.MSKDemodulator(BitOutput=true, ... InitialPhaseOffset=pi/4);
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); end fprintf('Error rate = %f\nNumber of errors = %d\n', ... errorStats(1), errorStats(2))
Error rate = 0.000000 Number of errors = 0
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:.
The specified frequency pulse shape corresponds to this rectangular pulse shape expression for g(t).
L is the main lobe pulse duration in symbol intervals.
The duration of the pulse, LT, is the pulse length in symbol intervals.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).
Introduced in R2012a