mskdemod

Minimum shift keying demodulation

Syntax

``Z = mskdemod(Y,nsamp)``
``Z = mskdemod(Y,nsamp,dataenc)``
``Z= mskdemod(Y,nsamp,dataenc,initphase)``
``Z= mskdemod(Y,nsamp,dataenc,initphase,initstate)``
``[Z,phaseout] = mskdemod(___)``
``[Z,phaseout,stateout] = mskdemod(___)``

Description

````Z = mskdemod(Y,nsamp)` applies differentially encoded minimum shift keying (MSK) demodulation to the MSK modulated signal, `Y`, and returns the demodulated input signal.```
````Z = mskdemod(Y,nsamp,dataenc)` specifies the data encoding method for MSK.```
````Z= mskdemod(Y,nsamp,dataenc,initphase)` specifies the initial phase of the MSK demodulator. ```
````Z= mskdemod(Y,nsamp,dataenc,initphase,initstate)` specifies the initial state of the MSK demodulator. ```
````[Z,phaseout] = mskdemod(___)` returns the final phase of `Y` for any of the input argument combinations in the previous syntaxes.```

example

````[Z,phaseout,stateout] = mskdemod(___)` returns the sample values corresponding to the last symbol of the previously received signal for any of the input argument combinations in the previous syntaxes.```

Examples

collapse all

Demodulate a noisy minimum shift keying (MSK) signal. Display the number of bit errors.

Set the number of samples per symbol for the MSK signal to 16.

`nsamp = 16;`

Initialize the simulation parameters.

```numerrs = 0; modPhase = zeros(1,2); demodPhase = zeros(1,2); demodState = complex(zeros(nsamp,2));```

The main processing loop includes these steps:

1. Generate binary data.

2. Apply MSK modulation to the data.

3. Pass the signal through an additive white Gaussian noise channel.

4. Demodulate the noisy MSK signal.

5. Determine the number of bit errors.

```for iRuns = 1:20 txData = randi([0 1],100,2); [modSig,modPhase] = mskmod(txData,nsamp,[],modPhase); rxSig = awgn(modSig,20,'measured'); [rxData,demodPhase,demodState] = mskdemod(rxSig,nsamp,[],demodPhase,demodState); numerrs = numerrs + biterr(txData,rxData); end```

Display the number of bit errors.

`numerrs`
```numerrs = 0 ```

Input Arguments

collapse all

MSK modulated signal, specified as a vector or matrix. If `Y` is a matrix, the function processes the columns independently.

Data Types: `single` | `double`
Complex Number Support: Yes

Number of samples per MSK symbol, specified as a positive integer.

Data Types: `single` | `double`

Data encoding method, specified as one of these options.

• `"diff"` — Use differentially encoded MSK.

• `"nondiff"` — Use nondifferentially encoded MSK.

• `[]` — Use to avoid overriding the default value.

Initial phase of the MSK demodulator in radians, specified as a scalar or row vector of integer multiples of `pi/2`. The length of `initphase` equals the number of channels in `Y`.

Data Types: `single` | `double`

Initial state of the demodulator, specified as an `nsamp`-by-`1` column vector or `nsamp`-by-C matrix. C is the number of channels in `Y`. The `initstate` argument contains the last symbol of the previously received signal.

Data Types: `single` | `double`

Output Arguments

collapse all

Demodulated input signal, returned as a column vector or matrix of binary values.

Data Types: `double` | `single`

Final phase of the MSK modulated signal, returned as a scalar or row vector in which each value is `0`, `pi/2`, `pi`, or `3*pi/2`. The output argument `phaseout` has the same dimensions as the input argument `initphase`.

Data Types: `single` | `double`

Sample values corresponding to the last symbol of the previously received signal, returned as an `nsamp`-by-`1` column vector or `nsamp`-by-C matrix. The output argument `stateout` has the same dimensions as the input argument `initstate`.

Data Types: `single` | `double`

References

[1] Pasupathy, S., “Minimum Shift Keying: A Spectrally Efficient Modulation.”IEEE Communications Magazine, July, 1979, pp. 14–22.

Version History

Introduced before R2006a

expand all