Main Content

wlanNonHTDataBitRecover

Recover PSDU from non-HT Data field

Since R2020b

Description

psdu = wlanNonHTDataBitRecover(sym,noiseVarEst,cfg) recovers psdu, a vector of physical layer service data unit (PSDU) bits, from sym, the demodulated and equalized OFDM symbols that make up the non-HT Data field of a non-high-throughput (non-HT) waveform. The function recovers the PSDU by using noise variance estimate noiseVarEst and non-HT transmission parameters cfg.

example

psdu = wlanNonHTDataBitRecover(sym,noiseVarEst,csi,cfg) enhances the demapping of OFDM subcarriers by using channel state information csi.

[psdu,scramInit] = wlanNonHTDataBitRecover(___) also recovers the initial scrambler state scramInit for any combination of input arguments from previous syntaxes.

example

[psdu,scramInit,serviceBits] = wlanNonHTDataBitRecover(___) additionally recovers the service field bits serviceBits for any combination of input arguments from previous syntaxes.

example

[___] = wlanNonHTDataBitRecover(___,OFDMSymbolOffset=symOffset) additionally specifies an OFDM symbol sampling offset for any combination of input and output arguments from previous syntaxes.

Examples

collapse all

Configure and generate a non-HT time-domain waveform.

cfg = wlanNonHTConfig(MCS=4);
bits = randi([0 1],8*cfg.PSDULength,1,'int8');
waveform = wlanWaveformGenerator(bits,cfg);

Transmit the waveform through an additive white Gaussian noise (AWGN) channel with a signal-to-noise ratio (SNR) of 30.

snr = 30;
rxWaveform = awgn(waveform,snr);

Extract the non-HT Data field from the received waveform.

field = 'NonHT-Data';
ind = wlanFieldIndices(cfg,field);
rx = rxWaveform(ind(1):ind(2),:);

Recover the frequency-domain signal by OFDM demodulating the time-domain data signal.

sym = wlanNonHTOFDMDemodulate(rx,field,cfg);

Extract the data subcarriers from the demodulated signal.

info = wlanNonHTOFDMInfo(field,cfg);
sym = sym(info.DataIndices,:,:);

Recover the PSDU and confirm that it matches the transmitted PSDU.

noiseVarEst = 10^(-snr/10);
psdu = wlanNonHTDataBitRecover(sym,noiseVarEst,cfg);
isequal(bits,psdu)
ans = logical
   1

Configure and generate a non-HT Data signal with a channel bandwidth of 160 MHz and dynamic bandwidth operation.

bandwidth = 'CBW160';
cfg = wlanNonHTConfig(ChannelBandwidth=bandwidth,PSDULength=1, ...
    SignalChannelBandwidth=true,BandwidthOperation='Dynamic');
bits = randi([0 1],8*cfg.PSDULength,1,'int8');
[range,~] = scramblerRange(cfg);
scramInit = randi(range);
y = wlanNonHTData(bits,cfg,scramInit);

Transmit the waveform through an AWGN channel with an SNR of 50.

snr = 50;
noiseVarEst = 10^(-snr/10);
rx = awgn(y,snr);

Recover the frequency-domain signal by OFDM-demodulating the non-HT Data signal, specifying an OFDM symbol sampling offset.

field = 'NonHT-Data';
symOffset = 0.5;
sym = wlanNonHTOFDMDemodulate(rx,field,bandwidth,OFDMSymbolOffset=symOffset);

Extract the data subcarriers.

info = wlanNonHTOFDMInfo(field,bandwidth);
sym = sym(info.DataIndices,:);

Recover the first 20 MHz subchannel of the PSDU, enhancing the demapping of the OFDM subcarriers by specifying channel state information. Confirm that the received and transmitted PSDUs match.

csi = ones(48,1);
[psdu,scramInit] = wlanNonHTDataBitRecover(sym(1:48,:),noiseVarEst,csi,cfg);
isequal(bits,psdu)
ans = logical
   1

Recover and display bandwidth signaling by interpreting the scrambler state.

[bandwidth,dyn] = wlanInterpretScramblerState(scramInit)
bandwidth = 
'CBW160'
dyn = logical
   1

Create a non-HT configuration object with a channel bandwidth of 320 MHz. Signal the channel bandwidth and the bandwidth operation in the scrambler sequence.

cfg = wlanNonHTConfig(ChannelBandwidth="CBW320",SignalChannelBandwidth=true, ...
    BandwidthOperation="Dynamic");

Generate a time-domain waveform for the configuration. To simulate a noiseless channel, set the received waveform equal to the transmitted waveform.

tx = wlanWaveformGenerator([1;0;0;1],cfg);
rx = tx;
noiseVarEst = 0;

Get field indices for the non-HT data field. Extract the part of the received waveform that corresponds to the data field.

dataInd = wlanFieldIndices(cfg,"NonHT-Data");
rxData = rx(dataInd(1):dataInd(2),:);

Demodulate the data field. Extract the data symbols.

rxSym = wlanNonHTOFDMDemodulate(rxData,"NonHT-Data",cfg);
info = wlanNonHTOFDMInfo("NonHT-Data",cfg);
dataSym = rxSym(info.DataIndices,:,:);

Recover the PSDU bits, initial scrambler state, and service bits from the first 20 MHz subchannel.

[psdu,scramInit,serviceBits] = wlanNonHTDataBitRecover(dataSym(1:48,:),noiseVarEst,cfg);

Interpret the scrambler state, using the default dot11CurrentChannelCenterFrequencyIndex1value of 0.

idx1 = 0;
[bandwidth,dyn] = wlanInterpretScramblerState(scramInit,idx1,serviceBits);

Display the recovered channel bandwidth and bandwidth operation indicator. They match the values you specified when you created the wlanNonHTConfig object.

disp(bandwidth)
CBW320
disp(dyn)
   1

Input Arguments

collapse all

Demodulated and equalized OFDM symbols that make up the non-HT Data field, specified as a complex-valued matrix of size 48-by-Nsym, where Nsym is the number of OFDM symbols.

Data Types: double | single
Complex Number Support: Yes

Noise variance estimate, specified as a nonnegative scalar.

Data Types: double | single

Non-HT transmission parameters, specified as a wlanNonHTConfig object.

Channel state information, specified as a real-valued column vector of length 48.

Data Types: double | single

OFDM symbol sampling offset, as a fraction of the cyclic prefix length, specified as a scalar in the interval [0, 1].

The value that you specify indicates the start location for OFDM demodulation relative to the beginning of the cyclic prefix.

Example: 0.45

Data Types: double

Output Arguments

collapse all

Recovered PSDU bits, returned as a binary-valued column vector of length 8 × L, where L is the PSDU length in bytes. To specify L, set the PSDULength property of the cfg input.

Data Types: int8

Initial scrambler state, returned as an integer in the interval [1, 127].

Section 17.3.5.5 of [1] specifies the scrambling and descrambling process applied to the transmitted data. The header and data fields that follow the scrambler initialization field (including data padding bits) are scrambled by XORing each bit with a length-127 periodic sequence generated by the polynomial S(x) = x7 + x4 + 1. The octets of the PSDU are placed into a bit stream, and, within each octet, bit 0 (LSB) is first and bit 7 (MSB) is last. This figure demonstrates the sequence generation and XOR operation.

Conversion from integer to bits uses left-MSB orientation. For example, initializing the scrambler with decimal 1, the bits map to these elements.

ElementX7X6X5X4X3X2X1
Bit Value0000001

To generate the bit stream equivalent to a decimal, use the int2bit function. For example, for decimal 1:

int2bit(1,7)'
ans =

     0     0     0     0     0     0     1

Data Types: int8

Since R2025a

Service field bits, returned as a binary column vector of length 16. The eighth bit is 1 when the channel bandwidth is 320 MHz and 0 otherwise.

Data Types: int8

References

[1] IEEE Std 802.11™-2020 (Revision of IEEE Std 802.11-2016). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.” IEEE Standard for Information Technology — Telecommunications and Information Exchange between Systems — Local and Metropolitan Area Networks — Specific Requirements.

Extended Capabilities

expand all

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

Version History

Introduced in R2020b

expand all