# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# comm.GMSKDemodulator System object

Demodulate using GMSK method and the Viterbi algorithm

## Description

The `GMSKDemodulator` object uses a Viterbi algorithm to demodulate a signal that was modulated using the Gaussian minimum shift keying method. The input is a baseband representation of the modulated signal.

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

1. Define and set up your GMSK demodulator object. See Construction.

2. Call `step` to demodulate a signal according to the properties of `GMSKDemodulator`. The behavior of `step` is specific to each object in the toolbox.

### Note

Starting in R2016b, instead of using the `step` method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, ```y = step(obj,x)``` and `y = obj(x)` perform equivalent operations.

## Construction

`H = comm.GMSKDemodulator` creates a demodulator System object, `H`. This object demodulates the input Gaussian minimum shift keying (GMSK) modulated data using the Viterbi algorithm.

`H = comm.GMSKDemodulator(Name,Value)` creates a GMSK demodulator object, `H`. This object has each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (`Name1`,`Value1`,...,`NameN`,`ValueN`).

## Properties

 `BitOutput` Output data as bits Specify whether the output is groups of bits or integer values. The default is `false`. When you set the `BitOutput` property to `false`, the `step` method outputs a column vector of length equal to N/`SamplesPerSymbol`. N is the length of the input signal, which is the number of input baseband modulated symbols. The elements of the output vector are `–1` or `1`. When you set the `BitOutput` property to `true`, the `step` method outputs a binary column vector of length equal to N/`SamplesPerSymbol` with bit values of `0` or `1`. `BandwidthTimeProduct` Product of bandwidth and symbol time of Gaussian pulse Specify the product of bandwidth and symbol time for the Gaussian pulse shape as a real, positive scalar. The default `0.3`. `PulseLength` Pulse length Specify the length of the Gaussian pulse shape in symbol intervals as a real positive integer. The default `4`. `SymbolPrehistory` Symbol prehistory Specify the data symbols used by the modulator prior to the first call to the `step` method. The default is `1`. This property requires a scalar or vector with elements equal to `-1` or `1`. If the value is a vector, its length must be one less than the value you set in the `PulseLength` property. `InitialPhaseOffset` Initial phase offset Specify the initial phase offset of the input modulated waveform in radians as a real, numeric scalar value. The default is `0`. `SamplesPerSymbol` Number of samples per input symbol Specify the expected number of samples per input symbol as a positive, integer scalar value. The default is `8`. `TracebackDepth` Traceback depth for Viterbi algorithm Specify the number of trellis branches that the Viterbi algorithm uses to construct each traceback path as a positive, integer scalar value. The value of this property is also the output delay, and the number of zero symbols that precede the first meaningful demodulated symbol in the output. The default is `16`. `OutputDataType` Data type of output Specify the output data type as one of `int8` | `int16` | `int32` | `double`, when you set the `BitOutput` property to `false`. When you set the `BitOutput` property to `true`, specify the output data type as one of `logical` | `double`. The default is `double`.

## Methods

 reset Reset states of the GMSK demodulator object step Demodulate using GMSK method and the Viterbi algorithm
Common to All System Objects
`clone`

Create System object with same property values

`getNumInputs`

Expected number of inputs to a System object

`getNumOutputs`

Expected number of outputs of a System object

`isLocked`

Check locked states of a System object (logical)

`release`

Allow System object property value changes

## Examples

expand all

```% Create a GMSK modulator, an AWGN channel, and a GMSK demodulator. Use a phase offset of pi/4. hMod = comm.GMSKModulator('BitInput', true, 'InitialPhaseOffset', pi/4); hAWGN = comm.AWGNChannel('NoiseMethod', ... 'Signal to noise ratio (SNR)','SNR',0); hDemod = comm.GMSKDemodulator('BitOutput', true, ... 'InitialPhaseOffset', pi/4); % Create an error rate calculator, account for the delay caused by the Viterbi algorithm hError = comm.ErrorRate('ReceiveDelay', hDemod.TracebackDepth); for counter = 1:100 % Transmit 100 3-bit words data = randi([0 1],300,1); modSignal = step(hMod, data); noisySignal = step(hAWGN, modSignal); receivedData = step(hDemod, noisySignal); errorStats = step(hError, data, receivedData); end fprintf('Error rate = %f\nNumber of errors = %d\n', ... errorStats(1), errorStats(2))```
```Error rate = 0.000133 Number of errors = 4 ```

This example illustrates the mapping of binary sequences of zeros and ones to the output of a GMSK modulator. The relationship also applies for MSK modulation.

Create a GMSK modulator that accepts binary inputs. Specify the pulse length and samples per symbol to be 1.

`gmsk = comm.GMSKModulator('BitInput',true,'PulseLength',1,'SamplesPerSymbol',1);`

Create an input sequence of all zeros. Modulate the sequence.

```x = zeros(5,1); y = gmsk(x)```
```y = 1.0000 + 0.0000i -0.0000 - 1.0000i -1.0000 + 0.0000i 0.0000 + 1.0000i 1.0000 - 0.0000i ```

Determine the phase angle for each point. Use the `unwrap` function to better show the trend.

`theta = unwrap(angle(y))`
```theta = 0 -1.5708 -3.1416 -4.7124 -6.2832 ```

A sequence of zeros causes the phase to shift by -π/2 between samples.

Reset the modulator. Modulate an input sequence of all ones.

```reset(gmsk) x = ones(5,1); y = gmsk(x)```
```y = 1.0000 + 0.0000i -0.0000 + 1.0000i -1.0000 - 0.0000i 0.0000 - 1.0000i 1.0000 + 0.0000i ```

Determine the phase angle for each point. Use the `unwrap` function to better show the trend.

`theta = unwrap(angle(y))`
```theta = 0 1.5708 3.1416 4.7124 6.2832 ```

A sequence of ones causes the phase to shift by +π/2 between samples.

## Algorithms

This object implements the algorithm, inputs, and outputs described on the GMSK Demodulator Baseband block reference page. The object properties correspond to the block parameters.