Main Content

genqamdemod

General quadrature amplitude demodulation

Description

z = genqamdemod(y,const) demodulates the complex envelope, y, of a quadrature amplitude modulated signal using the signal mapping specified in const.

example

z = genqamdemod(y,const,Name=Value) sets optional name-value arguments.

example

Examples

collapse all

Create the points that describe a hexagonal constellation.

inphase = [1/2 1 1 1/2 1/2 2 2 5/2];
quadr = [0 1 -1 2 -2 1 -1 0];
inphase = [inphase;-inphase]; inphase = inphase(:);
quadr = [quadr;quadr]; quadr = quadr(:);
const = inphase + 1i*quadr;

Plot the constellation.

h = scatterplot(const);

Figure Scatter Plot contains an axes object. The axes object with title Scatter plot, xlabel In-Phase, ylabel Quadrature contains a line object which displays its values using only markers. This object represents Channel 1.

Generate input data symbols. Modulate the symbols using this constellation.

x = [3 8 5 10 7];
y = genqammod(x,const);

Demodulate the modulated signal, y.

z = genqamdemod(y,const);

Plot the modulated signal in same figure.

hold on;
scatterplot(y,1,0,'ro',h);
legend('Constellation','Modulated signal');
hold off;

Figure Scatter Plot contains an axes object. The axes object with title Scatter plot, xlabel In-Phase, ylabel Quadrature contains 2 objects of type line. One or more of the lines displays its values using only markers These objects represent Constellation, Modulated signal.

Determine the number of symbol errors between the demodulated data to the original sequence.

numErrs = symerr(x,z)
numErrs = 
0

Calculate bit-wise approximate LLRs for 16-APSK modulation using a DVB-S2X constellation.

Generate a random bit sequence of length 24.

x = randi([0 1],24,1);

Define the 16-APSK constellation points for modulation.

constellation = [ ...
    0.4718 + 1j*0.2606;  0.2606 + 1j*0.4718; -0.4718 + 1j*0.2606; -0.2606 + 1j*0.4718; ...
    0.4718 - 1j*0.2606;  0.2606 - 1j*0.4718; -0.4718 - 1j*0.2606; -0.2606 - 1j*0.4718; ...
    1.2088 + 1j*0.4984;  0.4984 + 1j*1.2088; -1.2088 + 1j*0.4984; -0.4984 + 1j*1.2088; ...
    1.2088 - 1j*0.4984;  0.4984 - 1j*1.2088; -1.2088 - 1j*0.4984; -0.4984 - 1j*1.2088 ...
];

Modulate the bit sequence using the given constellation.

y = genqammod(x,constellation,InputType="bit");

Add Additive White Gaussian Noise (AWGN) to the modulated signal.

ynoisy =awgn(x,15);

Demodulate the modulated signal to compute approximate LLRs

z = genqamdemod(ynoisy,constellation,OutputType="approxllr",NoiseVariance=0.0316);

Input Arguments

collapse all

Complex envelope, specified as a scalar, vector, matrix, 3-D array, 4-D array, or gpuArray object. If y is a matrix with multiple rows, the function processes the rows independently.

Data Types: double | single
Complex Number Support: Yes

Signal mapping, specified as a complex vector, dlarray object, or gpuArray object.

Data Types: double | single
Complex Number Support: Yes

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: OutputType="integer" sets the output format to "integer".

Output format, specified as one of these options.

  • "integer" — The output z consists of integer symbol values.

  • "bit" — The output z consists of groups of bits.

  • "approxllr" — The output z consists of the bit-wise approximate log-likelihood ratio (LLR).

Data type of the output, specified as "double", "single", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", or "uint64". This name-value argument determines the data type of the final output. The data type of the output depends on the OutputType value you select.

  • When you set OutputType to "integer", the data type can be:

    • "double"

    • "single"

    • "int8"

    • "int16"

    • "int32"

    • "int64"

    • "uint8"

    • "uint16"

    • "uint32"

    • "uint64"

  • When you set OutputType to "bit", the data type can be "double", "single", or "int8".

  • When you set OutputType to "approxllr", the function ignores this name-value argument and the output data type remains the same as the input data type.

The default value is the data type of input y.

Noise variance, specified as a positive scalar or positive vector. When you specify as a scalar, the function uses the same noise variance value for LLR computations on all input elements. When you specify as a vector, the vector length must be equal to the number of elements in the last dimension of the input signal. Each element of the vector specifies the noise variance for all the elements of the input along the corresponding last dimension.

Dependencies

To enable this name-value argument, set OutputType to "approxllr".

Output Arguments

collapse all

Message signal, returned as a scalar, vector, matrix, 3-D array, 4-D array, or gpuArray object. The message signal consists of integers between 0 and length(const)–1. The data type of z is the same as the data type of input x.

When you set OutputType to "bit" or "approxllr", the number of rows in the output z is log2(M) times the number of rows in the input y. The function maps each demodulated symbol to a group of log2(M) bits, with the first bit representing the most significant bit (MSB) and the last bit representing the least significant bit (LSB). M is the modulation order.

z is a gpuArray object if either y or const is a gpuArray object.

Data Types: double | single

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

expand all