Documentation

# comm.GeneralQAMDemodulator

Demodulate using arbitrary QAM constellation

## Description

The `GeneralQAMDemodulator` object demodulates a signal that was modulated using quadrature amplitude modulation. The input is a baseband representation of the modulated signal.

To demodulate a signal that was modulated using quadrature amplitude modulation:

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

2. Call `step` to demodulate a signal according to the properties of `comm.GeneralQAMModulator`. 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.GeneralQAMDemodulator` creates a demodulator System object, `H`. This object demodulates the input signal using a general quadrature amplitude modulation (QAM) method.

`H = comm.GeneralQAMDemodulator(Name,Value)` creates a general QAM 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.GeneralQAMDemodulator(CONST,Name,Value)` creates a general QAM demodulator object, `H`. This object has the `Constellation` property set to `CONST`, and the other specified properties set to the specified values.

## Properties

 `Constellation` Signal constellation Specify the constellation points as a real or complex, double-precision data type vector. The default is exp($2×\pi ×1i×\left(0:7\right)}{8}$). The length of the vector determines the modulation order. When you set the `BitOutput` property to `false`, the `step` method outputs a vector with integer values. These integers are between `0` and M–1, where M is the length of this property vector. The length of the output vector equals the length of the input signal. When you set the `BitOutput` property to `true`, the output signal contains bits. For bit outputs, the size of the signal constellation requires an integer power of two and the output length is an integer multiple of the number of bits per symbol. `BitOutput` Output data as bits Specify whether the output consists of groups of bits or integer symbol values. The default is `false`. When you set this property to `true` the `step` method outputs a column vector of bit values with length equal to log2(M) times the number of demodulated symbols, where M is the length of the signal constellation specified in the `Constellation` property. The length M determines the modulation order. When you set this property to `false`, the `step` method outputs a column vector, of length equal to the input data vector. The vector contains integer symbol values between `0` and M–1. `DecisionMethod` Demodulation decision method Specify the decision method the object uses as one of `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 `DecisionMethod` property to ```Log-likelihood ratio``` or ```Approximate log-likelihood ratio```. `Variance` Noise variance Specify the variance of the noise as a nonzero, 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 would compute the exponential of very large or very small numbers using finite-precision arithmetic. In such cases, using approximate LLR is recommended because its algorithm does not compute exponentials. This property applies when you set the `VarianceSource` property to `Property`. This property is tunable. `OutputDataType` Data type of output Specify the output data type as one of `Full precision` | ```Smallest unsigned integer``` | `double` | `single` | `int8` | `uint8` | `int16` | `uint16` | `int32` | `uint32`. The default is `Full precision `. This property applies only when you set the `BitOutput` property to `false` or when you set the `BitOutput` property to `true` and the `DecisionMethod` property to ```Hard decision``` or ```Approximate log-likelihood ratio```. In this case, when you set the `OutputDataType` property to ```Full precision```, the output data type is the same as that of the input when the input data has a single or double-precision data type. When the input data is of a fixed-point type, the output data type works as if you had set the `OutputDataType` property to `Smallest unsigned integer`. When the input signal is an integer data type, you must have a Fixed-Point Designer™ user license to use this property in ```Smallest unsigned integer``` or `Full precision` mode. When you set the `BitOutput` property to `true`, and the `DecisionMethod` property to ```Hard Decision``` the data type `logical` becomes a valid option. When you set the `BitOutput` property to `true` and the `DecisionMethod` property to ```Approximate log-likelihood ratio``` you may only set this property to ```Full precision``` | `Custom`. If you set the `BitOutput` property to `true` and the `DecisionMethod` property to ```Log-likelihood ratio```, the output data has the same type as that of the input. In this case, that value can be only single or double precision.

## Methods

 step Demodulate using arbitrary QAM constellation
Common to All System Objects
`release`

Allow System object property value changes

## Examples

Modulate and demodulate data using an arbitrary three-point constellation.

``` % Setup a three point constellation c = [1 1i -1]; hQAMMod = comm.GeneralQAMModulator(c); hAWGN = comm.AWGNChannel('NoiseMethod', ... 'Signal to noise ratio (SNR)','SNR',15, 'SignalPower', 0.89); hQAMDemod = comm.GeneralQAMDemodulator(c); %Create an error rate calculator hError = comm.ErrorRate; for counter = 1:100 % Transmit a 50-symbol frame data = randi([0 2],50,1); modSignal = step(hQAMMod, data); noisySignal = step(hAWGN, modSignal); receivedData = step(hQAMDemod, noisySignal); errorStats = step(hError, data, receivedData); end fprintf('Error rate = %f\nNumber of errors = %d\n', ... errorStats(1), errorStats(2))```

expand all

## Algorithms

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