wlanConstellationDemap

Constellation demapping

Description

example

y = wlanConstellationDemap(sym,noiseVarEst,numBPSCS) demaps the received input sym using the soft-decision approximate LLR method for the specified number of coded bits per subcarrier per spatial stream numBPSCS. The received symbols must be generated with one of these modulations:

  • BPSK, QPSK, 16QAM, or 64QAM, as per IEEE® 802.11™-2012, Section 18.3.5.8

  • 256QAM, as per IEEE 802.11ac™-2012, Section 22.3.10.9.1

  • 1024QAM, as per IEEE 802.11-16/0922r2

example

y = wlanConstellationDemap(sym,noiseVarEst,numBPSCS,demapType) specifies the demapping type.

example

y = wlanConstellationDemap(sym,noiseVarEst,numBPSCS,phase) derotates the symbols clockwise before demapping by the number of radians specified in phase.

example

y = wlanConstellationDemap(sym,noiseVarEst,numBPSCS,demapType,phase) specifies the demapping type and the phase rotation.

Examples

collapse all

Perform a 256QAM demapping, as defined in IEEE® 802.11ac™-2013, Section 22.3.10.9.1.

Create the sequence of data bits.

bits = randi([0 1],416,1,'int8');

Perform the constellation mapping on the data bits by using a 256QAM modulation. The size of the output returned equals the size of the input sequence divided by eight.

numBPSCS = 8;
mappedData = wlanConstellationMap(bits,numBPSCS);
size(mappedData)
ans = 1×2

    52     1

Perform the 256QAM constellation demapping. Because the default demapping type is soft, the output is a vector of soft bits.

noiseVar = 0;
demappedData = wlanConstellationDemap(mappedData,noiseVar,numBPSCS);
size(demappedData)
ans = 1×2

   416     1

Perform a 256QAM demapping by using hard demodulation. The demapping is defined in IEEE® 802.11™-2012 Section 18.3.5.8

Create the sequence of data bits.

 bits = randi([0 1],416,1);

Perform the constellation mapping on the data bits by using a 256QAM constellation.

numBPSCS = 8;
mappedData = wlanConstellationMap(bits,numBPSCS);

Perform the hard 256QAM constellation demapping. Because it is a hard demapping, the estimated noise variance is ignored.

noiseVar = 0;
demapType = 'hard';
demappedData = wlanConstellationDemap(mappedData,noiseVar,numBPSCS,demapType);

Verify that the demapped data matches the original data.

isequal(bits,demappedData)
ans = logical
   1

BPSK and QBPSK demapping for different OFDM symbols for the VHT-SIG-A field by using a soft demodulation. The demapping is defined in IEEE® 802.11ac™-2013 Section 22.3.8.3.3

Create the sequence of data bits. Specify the two OFDM symbols in columns.

 bits = randi([0 1],48,2,'int8');

Perform constellation mapping on the data bits. Specify the size of the constellation rotation as the number in columns of the input sequence. The first column is mapped with a BPSK modulation. The second column is modulated with a QBPSK modulation.

numBPSCS = 1;
phase = [0 pi/2];
mappedData = wlanConstellationMap(bits,numBPSCS,phase);

Perform the constellation demapping with an estimated variance noise equal to zero (no added noise). To derotate the constellation, specify the same phase as in the mapping function. The output is a vector of soft bits ready to be the input of a convolutional decoder.

noiseVar = 0;
demappedData = wlanConstellationDemap(mappedData,noiseVar,numBPSCS,phase);

Verify that the demapped data matches the original data. Because no noise is present, you can recover the original data without errors by assigning the negative values to a logical 1 and the positive values to a logical 0. In other words, you can convert the soft bits into hard bits.

demappedBits = int8((demappedData<=0));
isequal(bits,demappedBits)
ans = logical
   1

Perform QBPSK demapping on a four-dimensional array by using hard demodulation.

Create the sequence of data bits as an array of four dimensions, with 416 coded bits per subcarrier per spatial stream per interleaver block, four OFDM symbols, two spatial streams, and two segments.

numCBPSSI = 416; 
numSym = 4;
numSS = 2;
numSeg = 2; 
bits = randi([0 1],numCBPSSI,numSym,numSS,numSeg);
size(bits)
ans = 1×4

   416     4     2     2

Perform QBPSK constellation mapping on the data bits with a rotation of π2 radians.

numBPSCS = 1;
phase = pi/2;
mappedData = wlanConstellationMap(bits,numBPSCS,phase);
size(mappedData)
ans = 1×4

   416     4     2     2

Perform hard QBPSK constellation demapping. To de-rotate the constellation, specify the same phase as in the mapping function. Because it is a hard demapping, the estimated noise variance is ignored.

noiseVar = 0;
demapType = 'hard';
demappedData = wlanConstellationDemap(mappedData,noiseVar,numBPSCS,demapType);

Verify that the demapped data matches the original data.

isequal(bits,demappedData)
ans = logical
   1

Input Arguments

collapse all

Input sequence of received symbols, specified as a numeric vector, matrix, or multidimensional array of integers.

Data Types: double
Complex Number Support: Yes

Noise variance estimate, specified as a nonnegative scalar. When the demapping type is set to 'hard', the noise variance estimate is not required and therefore is ignored.

Example: 0.7071

Data Types: double

Number of coded bits per subcarrier per spatial stream, specified as log2(M), where M is the modulation order. Therefore, numBPSCS must equal:

  • 1 for a BPSK modulation

  • 2 for a QPSK modulation

  • 4 for a 16QAM modulation

  • 6 for a 64QAM modulation

  • 8 for a 256QAM modulation

  • 10 for a 1024QAM modulation

Example: 4

Data Types: double

Demapping type, specified as a character vector or a string scalar. It can be 'hard' for hard-decision demapping or 'soft' for the soft-decision approximate LLR method.

Data Types: double

Constellation rotation in radians, specified as a scalar, vector, or multidimensional array. The size of phase must be compatible with the size of the input sym. phase and sym have compatible sizes if, for each corresponding dimension, the dimension sizes are either equal or one of them is 1. When one of the dimensions of sym is equal to 1, and the corresponding dimension of phase is larger than 1, then the output dimensions have the same size as the dimensions of phase.

Example: pi*(0:size(bits,1)/numBPSCS-1).'/2;

Data Types: double

Output Arguments

collapse all

Demapped symbols, returned as a numeric vector, matrix, or multidimensional array of integers. y has the same size as sym except for the number of rows, which is equal to the number of rows of sym, multiplied by numBPSCS.

Extended Capabilities

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

Introduced in R2017b