Main Content

wlanInterpretScramblerState

Recover bandwidth signaling from initial scrambler state

Description

example

[bandwidth,dyn] = wlanInterpretScramblerState(scramInit) recovers bandwidth signaling from initial scrambler state scramInit. The function returns bandwidth, the channel bandwidth, and dyn, an indication of whether bandwidth operation is dynamic or static.

[bandwidth,dyn] = wlanInterpretScramblerState(scramInit,idx1) specifies idx1, the dot11CurrentChannelCenterFrequencyIndex1 parameter, as defined in Table 17-9 of [1].

Examples

collapse all

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

Input Arguments

collapse all

Initial scrambler state, specified as an integer in the interval [1, 127], or the corresponding binary-valued column vector of length 7.

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 the initialization of the scrambler with decimal 1, the bits are mapped to the elements shown.

ElementX7X6X5X4X3X2X1
Bit value0000001

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

de2bi(1,7,'left-msb')
ans =

     0     0     0     0     0     0     1

Example: [1; 0; 1; 1; 1; 0; 1] conveys the scrambler initialization state of 93 as a binary-valued column vector.

Data Types: double

dot11CurrentChannelCenterFrequencyIndex1 parameter, as defined in Table 17-9 of [1], specified as a scalar in the interval [0, 200].

Data Types: double

Output Arguments

collapse all

Recovered channel bandwidth, returned as one of these values.

  • 'CBW20' — Channel bandwidth of 20 MHz

  • 'CBW40' — Channel bandwidth of 40 MHz

  • 'CBW80' — Channel bandwidth of 80 MHz

  • 'CBW160' — Channel bandwidth of 160 MHz

  • 'CBW80+80' — Channel bandwidth of 160 MHz comprising two non-adjacent 80 MHz channels

Data Types: char

Indication of whether bandwidth operation is dynamic or static, returned as a logical 1 or 0. A value of 0 indicates static bandwidth operation. A value of 1 indicates dynamic bandwidth operation.

Data Types: logical

References

[1] IEEE Std 802.11™-2016 (Revision of IEEE Std 802.11-2012). “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

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

Introduced in R2020b