Main Content

comm.GMSKDemodulator

Demodulate GMSK-modulated signal

Description

The comm.GMSKDemodulator System object™ uses a Viterbi algorithm or maximum logarithmic a posteriori probability (max-log-MAP) algorithm to demodulate a signal that was modulated using the Gaussian minimum shift keying (GMSK) method. The input is a baseband representation of the modulated signal.

To demodulate a GMSK-modulated signal:

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

Creation

Description

example

gmskdemodulator = comm.GMSKDemodulator creates a demodulator System object that demodulates the input GMSK-modulated data by using the Viterbi algorithm or the max-log MAP algorithm. For more information, see Algorithms.

gmskdemodulator = comm.GMSKDemodulator(Name,Value) sets properties using one or more name-value pairs. For example, comm.GMSKDemodulator(PulseLength=6) specifies the length of the Gaussian pulse shape as 6 symbol intervals.

Properties

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 data as bits, specified as a numeric or logical 0 (false) or 1 (true). When you run the object, the output is a 1-by-(N / SamplesPerSymbol) column vector. N is the length of the input signal, X, which is the number of input baseband modulated symbols.

  • When you set this property to false, the values output are -1 or 1.

  • When you set this property to true, the values that are output depend on the DecisionMethod property setting.

Data Types: logical

Demodulation decision method, specified as 'Hard decision' or 'Approximate log-likelihood ratio'.

  • When you set this property to 'Hard decision', the output, Y, is returned as a column vector with element values of 0 or 1. The output data type is specified by OutputDataType.

  • When you set this property to 'Approximate log-likelihood ratio', the output data type is the same as the input, X. For the approximate log-likelihood ratio, the object generates positive values for 0s and negative values for 1s.

For more information, see Algorithms.

Dependencies

This property applies when you set BitOutput to true.

Source of noise variance, specified as 'Property' or 'Input port'.

  • When you set this property to 'Property', you set the noise variance by using the Variance property.

  • When you set this property to 'Input port', you set the noise variance by using the nvar input argument.

Dependencies

This property applies when you set DecisionMethod to 'Approximate log-likelihood ratio'.

Noise variance, specified as a positive scalar value.

Tunable: Yes

Dependencies

This property applies when you set VarianceSource to 'Property' and DecisionMethod to 'Approximate log-likelihood ratio'.

Data Types: double

Product of the bandwidth and symbol time for the Gaussian pulse shape, specified as a positive scalar value. For more information, see Algorithms.

Data Types: double

Pulse length, specified as a positive integer. The pulse length value represents the length of the Gaussian pulse shape in symbol intervals.

Data Types: double

Symbol prehistory, specified as -1, 1, or a vector with elements equal those values. The symbol prehistory indicates the data symbols that the modulator uses prior to the first call of the object, in reverse chronological order.

  • A scalar value expands to a vector of length PulseLength – 1.

  • For a vector, the length must be PulseLength – 1.

Data Types: double

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

Data Types: double

Number of samples per symbol, specified as a positive integer. The number of samples per symbol represents the upsampling factor from input samples to output samples.

Data Types: double

Traceback depth for the Viterbi algorithm or max-log-MAP algorithm, specified as a positive integer.

The traceback depth is the number of trellis branches that the Viterbi algorithm uses to construct each traceback path or that the max-log-MAP algorithm uses for the backward path metric calculation. The number of zero symbols that precede the first decoded symbol in the output represents a decoding delay.

Data Types: double

Output data type, 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 and DecisionMethod to 'Hard decision', you can set the output data type to 'double', 'int8', or 'logical'.

  • When you set the BitOutput property to true and DecisionMethod to 'Approximate log-likelihood ratio', the output data type is the same as the input, X.

Dependencies

This property applies when you set BitOutput to false, or when you set BitOutput to true and DecisionMethod to 'Hard decision'.

Usage

Description

example

Y = gmskdemodulator(X) applies GMSK demodulation to the GMSK-modulated waveform and returns the demodulated input signal.

Y = gmskdemodulator(X,nvar) returns the GMSK-demodulated input signal with the Variance property set to nvar. This syntax applies when you set VarianceSource to 'Input port' and DecisionMethod to 'Approximate log-likelihood ratio'.

Input Arguments

expand all

GMSK-modulated baseband signal, specified as a column vector with a length equal to an integer multiple of the number of SamplesPerSymbol.

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

Noise variance, specified as a positive scalar value.

Dependencies

This property applies when you set VarianceSource to 'Input port' and DecisionMethod to 'Approximate log-likelihood ratio'.

Data Types: double | single

Output Arguments

expand all

Demodulated signal, returned as a column vector with length equal to (N / SamplesPerSymbol). N is the length of the input signal, X, which is the number of input baseband modulated symbols.

  • When you set BitOutput to false, Y is returned as a column vector with element values of -1 or 1.

  • When you set BitOutput to true, the values returned in Y depend on the DecisionMethod property setting.

    • When you set DecisionMethod to 'Hard decision', Y is returned as a column vector with element values of 0 or 1.

    • When you set DecisionMethod to 'Approximate log-likelihood ratio', Y is returned as a column vector approximate log-likelihood ratios with positive values representing 0s and negative values representing 1s.

To specify the output data type, use 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:

release(obj)

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

Examples

collapse all

Create a GMSK modulator and demodulator pair. Create an AWGN channel object.

gmskmodulator = comm.GMSKModulator( ...
    BitInput=true, ...
    InitialPhaseOffset=pi/4);
gmskdemodulator = comm.GMSKDemodulator( ...
    BitOutput=true, ...
    InitialPhaseOffset=pi/4);
channel = comm.AWGNChannel( ...
    NoiseMethod='Signal to noise ratio (SNR)', ...
    SNR=0);

Create an error rate calculator and account for the delay between the modulator and demodulator, caused by the Viterbi algorithm.

errorRate = comm.ErrorRate( ...
    ReceiveDelay=gmskdemodulator.TracebackDepth);

Process 100 frames of data looping through these steps.

  1. Generate vectors with 300 elements of random binary data.

  2. GMSK-modulate the data.

  3. Pass the modulated data through the AWGN channel.

  4. GMSK-demodulate the data.

  5. Collect error statistics on the frames of data.

for counter = 1:100
   % Transmit 100 3-bit words
   data = randi([0 1],300,1);
   modSignal = gmskmodulator(data);
   noisySignal = channel(modSignal);
   receivedData = gmskdemodulator(noisySignal);
   errorStats = errorRate(data, receivedData);
end

Display the error statistics.

fprintf('Error rate = %f\nNumber of errors = %d\n', ...
         errorStats(1), errorStats(2))
Error rate = 0.000133
Number of errors = 4

Algorithms

expand all

References

[1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase Modulation. New York: Plenum Press, 1986.

[2] Benedetto, S., G. Montorsi, D. Divsalar, and F. Pollara. "A Soft-Input Soft-Output Maximum A Posterior (MAP) Module to Decode Parallel and Serial Concatenated Codes." Jet Propulsion Lab TDA Progress Report, 42–127, (November 1996).

[3] Viterbi, A.J. “An Intuitive Justification and a Simplified Implementation of the MAP Decoder for Convolutional Codes.” IEEE Journal on Selected Areas in Communications 16, no. 2 (February 1998): 260–64. https://doi.org/10.1109/49.661114.

Extended Capabilities

Version History

Introduced in R2012a

expand all