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.QPSKDemodulator System object

Demodulate using QPSK method

Description

The `QPSKDemodulator` object demodulates a signal that was modulated using the quaternary phase shift keying method. The input is a baseband representation of the modulated signal.

To demodulate a signal that was modulated using quaternary phase shift keying:

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

2. Call `step` to demodulate the signal according to the properties of `comm.QPSKDemodulator`. 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.QPSKDemodulator` creates a demodulator System object, `H`. This object demodulates the input signal using the quadrature phase shift keying (QPSK) method.

`H = comm.QPSKDemodulator(Name,Value)` creates a QPSK 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.QPSKDemodulator(PHASE,Name,Value)` creates a QPSK demodulator object, `H`. This object has the `PhaseOffset` property set to `PHASE`, and the other specified properties set to the specified values.

Properties

 `PhaseOffset` Phase of zeroth point in constellation Specify the phase offset of the zeroth point in the constellation, in radians, as a real scalar value. The default is `pi/4`. `BitOutput` Output data as bits Specify whether the output consists of groups of bits or integer symbol values. When you set this property to `true`, the `step` method outputs a column vector of bit values with length equal to twice the number of demodulated symbols. When you set this property to `false`, the `step` method outputs a column vector with length equal to the input data vector. This vector contains integer symbol values between `0` and `3`. The default is `false`. `SymbolMapping` Constellation encoding Specify how the object maps an integer or group of 2 bits to the corresponding symbol as one of `Binary` | `Gray`. The default is `Gray`. When you set this property to `Gray`, the object uses a Gray-encoded signal constellation. When you set this property to `Binary`, the integer `m`, between $0\le m\le 3$ maps to the complex value exp(j$×$`PhaseOffset` + j$×$$2\pi ×m}{4}$). `DecisionMethod` Demodulation decision method Specify the decision method the object uses as ```Hard decision``` | `Log-likelihood ratio` | ```Approximate log-likelihood ratio```. The default is `Hard decision`. When you set the `BitOutput` property to `false`, the object always performs hard decision demodulation. This property applies when you set the `BitOutput` property to `true`. `VarianceSource` Source of noise variance Specify the source of the noise variance as one of `Property` | `Input port`. The default is `Property`. This property applies when you set the `BitOutput` property to `true` and the `DecisionMethod` property to `Log-likelihood ratio` or `Approximate log-likelihood ratio`. `Variance` Noise variance Specify the variance of the noise as a positive, real scalar value. The default is `1`. If this value is very small (i.e., SNR is very high), log-likelihood ratio (LLR) computations may yield `Inf` or `-Inf`. This result occurs because the LLR algorithm computes the exponential of very large or very small numbers using finite-precision arithmetic. In such cases, use approximate LLR is because that option's algorithm does not compute exponentials. This property applies when you set the `BitOutput` property to `true`, the `DecisionMethod` property to `Log-likelihood ratio` or `Approximate log-likelihood ratio`, and the `VarianceSource` property to `Property`.This property is tunable. `OutputDataType` Data type of output Specify the output data type as `Full precision` | ```Smallest unsigned integer``` | `double` | `single` | `int8` | `uint8` | `int16` | `uint16` | `int32` | `uint32`. The default is `Full precision`. This property applies when you set the `BitOutput` property to `false`. The property also applies when you set the `BitOutput` property to `true` and the `DecisionMethod` property to `Hard decision`. In this second case, when the `OutputDataType` property is set to `Full precision`, and the input data type is single or double precision, the output data has the same as that of the input. When the input data is of a fixed-point type, the output data type behaves as if you had set the `OutputDataType` property to `Smallest unsigned integer`. When you set `BitOutput` to `true` and the `DecisionMethod` property to `Hard Decision`, then `logical` data type becomes a valid option. When you set the `BitOutput` property to `true` and the `DecisionMethod` property to ```Log-likelihood ratio``` or `Approximate log-likelihood ratio`, the output data type is the same as that of the input. In this case, that data type can only be single or double precision.

Methods

 constellation Calculate or plot ideal signal constellation step Demodulate using QPSK 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

Create a QPSK modulator.

`mod = comm.QPSKModulator;`

Determine the reference constellation points.

`refC = constellation(mod)`
```refC = 0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i ```

Plot the constellation.

`constellation(mod)`

Create a PSK demodulator having 0 phase offset.

`demod = comm.QPSKDemodulator('PhaseOffset',0);`

Plot its reference constellation. The `constellation` method works for both modulator and demodulator objects.

`constellation(demod)`

Create a QPSK modulator and demodulator pair that operate on bits.

```qpskModulator = comm.QPSKModulator('BitInput',true); qpskDemodulator = comm.QPSKDemodulator('BitOutput',true);```

Create an AWGN channel object and an error rate counter.

```channel = comm.AWGNChannel('EbNo',4,'BitsPerSymbol',2); errorRate = comm.ErrorRate;```

Generate random binary data and apply QPSK modulation.

```data = randi([0 1],1000,1); txSig = qpskModulator(data);```

Pass the signal through the AWGN channel and demodulate it.

```rxSig = channel(txSig); rxData = qpskDemodulator(rxSig);```

Calculate the error statistics. Display the BER.

```errorStats = errorRate(data,rxData); errorStats(1)```
```ans = 0.0100 ```

Algorithms

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