# 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.FSKDemodulator System object

Package: comm

Demodulate using M-ary FSK method

## Description

The `FSKDemodulator` object demodulates a signal that was modulated using the M-ary frequency shift keying method. The input is a baseband representation of the modulated signal. The input and output for this object are discrete-time signals.

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

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

2. Call `step` to demodulate a signal according to the properties of `FSKDemodulator`. 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.FSKDemodulator` creates a demodulator System object, `H`. This object demodulates an M-ary frequency shift keying (M-FSK) signal using a noncoherent energy detector.

`H = comm.FSKDemodulator(Name,Value)` creates an M-FSK demodulator object, `H`, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (`Name1`,`Value1`,...,`NameN`,`ValueN`).

`H = comm.FSKDemodulator(M,FREQSEP,RS,Name,Value)` creates an M-FSK demodulator object, `H`. This object has the `ModulationOrder` property set to `M`, the `FrequencySeparation` property set to `FREQSEP`, the `SymbolRate` property set to `RS`, and the other specified properties set to the specified values.

## Properties

 `ModulationOrder` Number of frequencies in modulated signal Specify the number of frequencies in the modulated signal as a numeric, positive, integer scalar value that is a power of two. The default is `8`. `BitOutput` Output data as bits Specify whether the output is groups of bits or integer values. The default is `false`. When you set this property to `false`, the `step` method outputs a column vector of length equal to N/`SamplesPerSymbol`. N is the length of the input data vector to the step method. The elements of the output vector are integers between `0` and `ModulationOrder`–1. When you set this property to `true`, the `step` method outputs a column vector of length equal to log2(`ModulationOrder`)$×$(N/`SamplesPerSymbol`). The property's elements are bit representations of integers between `0` and `ModulationOrder`–1. `SymbolMapping` Symbol encoding Specify how the object maps an integer or group of log2(`ModulationOrder`) bits to the corresponding symbol as one of `Binary` | `Gray`. The default is `Gray`. When you set this property to `Gray`, the object uses Gray-coded ordering. When you set this property to `Binary`, the object uses natural binary-coded ordering. For either type of mapping, the object maps the highest frequency to the integer 0 and maps the lowest frequency to the integer M–1. In baseband simulation, the lowest frequency is the negative frequency with the largest absolute value. `FrequencySeparation` Frequency separation between successive tones Specify the frequency separation between successive symbols in the modulated signal in Hertz as a positive, real scalar value. The default is `6` Hz. `SamplesPerSymbol` Number of samples per input symbol Specify the number of samples per input symbol as a positive, integer scalar value. The default is `17`. `SymbolRate` Symbol duration Specify the symbol rate in symbols per second as a positive, double-precision, real scalar value. The default is `100`. To avoid output signal aliasing, specify an output sampling rate, Fs = `SamplesPerSymbol`$×$`SymbolRate`, which is greater than `ModulationOrder` $×$ `FrequencySeparation`. The symbol duration remain the same, regardless of whether the input is bits or integers. `OutputDataType` Data type of output Specify the output data type as one of `logical` | `int8` | `uint8` | `int16` | `uint16` | `int32` | `uint32` | `double`. The default is `double`. The `logical` type is valid only when you set the `BitOutput` property to false and the `ModulationOrder` property to two. When you set the `BitOutput` property to true, the output data requires a type of `logical` | `double`.

## Methods

 reset Reset states of M-FSK demodulator object step Demodulate using M-ary FSK method
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

Modulate and demodulate a signal using 8-FSK modulation with a frequency separation of 100 Hz.

Set the modulation order and frequency separation parameters.

```M = 8; freqSep = 100; ```

Create FSK modulator and demodulator System objects™ with modulation order 8 and 100 Hz frequency separation.

```fskMod = comm.FSKModulator(M,freqSep); fskDemod = comm.FSKDemodulator(M,freqSep); ```

Create an additive white Gaussian noise channel, where the noise is specified as a signal-to-noise ratio.

```ch = comm.AWGNChannel('NoiseMethod', ... 'Signal to noise ratio (SNR)','SNR',-2); ```

Create an error rate calculator object.

```err = comm.ErrorRate; ```

Transmit one hundred 50-symbol frames using 8-FSK in an AWGN channel.

```for counter = 1:100 data = randi([0 M-1],50,1); modSignal = step(fskMod,data); noisySignal = step(ch,modSignal); receivedData = step(fskDemod,noisySignal); errorStats = step(err,data,receivedData); end ```

Display the error statistics.

```es = 'Error rate = %4.2e\nNumber of errors = %d\nNumber of symbols = %d\n'; fprintf(es,errorStats) ```
```Error rate = 1.40e-02 Number of errors = 70 Number of symbols = 5000 ```

## Algorithms

This object implements the algorithm, inputs, and outputs described on the M-FSK Demodulator Baseband block reference page. The object properties correspond to the block parameters, except: