# comm.MSKDemodulator

Demodulate using MSK method and Viterbi algorithm

## Description

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.

## Creation

### Syntax

``mskdemod = comm.MSKDemodulator``
``mskdemod = comm.MSKDemodulator(Name=Value)``

### Description

example

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

example

````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.```

## 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.

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

• 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 `-1` or `1`.

• 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 `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 output, specified as:

• `int8`, `int16`, `int32`, or `double` when you set the `BitOutput` property to false.

• `double` or `logical` when you set the `BitOutput` property to true.

## Usage

### Syntax

``y = mskdemod(x)``

### Description

````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.

Data Types: `single` | `double`

### 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.

## 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

 `step` Run System object algorithm `release` Release resources and allow changes to System object property values and input characteristics `reset` Reset internal states of System object

## Examples

collapse all

Create an MSK modulator and an MSK demodulator. Use a phase offset of $\pi /4$.

``` 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 ```

## Algorithms

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\left(t\right)={\int }_{-\text{\hspace{0.17em}}\infty }^{t}g\left(t\right)dt$.

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

Pulse ShapeExpression
`Rectangular`$g\left(t\right)=\left\{\begin{array}{cc}\frac{1}{2LT},& 0\le t\le LT\\ 0& \text{otherwise}\end{array}$

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

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

## Version History

Introduced in R2012a
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 3, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.43550342321395874, "perplexity": 3080.6548676141347}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335491.4/warc/CC-MAIN-20220930145518-20220930175518-00195.warc.gz"}