Main Content

wlanSegmentParseBits

Segment-parse data bits

Description

example

y = wlanSegmentParseBits(bits,cbw,numES,numCBPS,numBPSCS) performs segment parsing on the input bits as per IEEE® 802.11™-2020, Section 21.3.10.7, when cbw is 'CBW16' or 'CBW160'.

Note

Segment parsing of the bits applies only when the channel bandwidth is either 16 MHz or 160 MHz, and is bypassed for the remaining channel bandwidths (as stated in the aforementioned section of IEEE 802.11-2020). Therefore, when cbw is any accepted value other than 'CBW16' or 'CBW160', wlanSegmentParseBits returns the input unchanged.

Examples

collapse all

Segment-parse coded bits for a VHT configuration (with a channel bandwidth of 160 MHz and three spatial streams) into two OFDM symbols.

Define the input parameters. Set the channel bandwidth to 160 MHz, the number of coded bits per OFDM symbol to 2808, the number of spatial streams to 3, the number of encoded streams to 1, the number of coded bits per subcarrier per spatial stream to 2, and the number of OFDM symbols to 2. Calculate the number of coded bits per OFDM symbol per spatial stream by dividing the number of coded bits per OFDM symbol by the number of spatial streams.

chanBW = 'CBW160';
numCBPS = 2808;
numSS = 3;
numES = 1;
numBPSCS = 2;
numSym = 2;
numCBPSS = numCBPS/numSS;

Create the input sequence of bits.

bits = randi([0 1],numCBPSS*numSym,numSS,'int8');

Perform segment parsing on the bits.

parsedBits = wlanSegmentParseBits(bits,chanBW,numES,numCBPS,numBPSCS);

The parsed sequence is a three-dimensional array of bits.

size(parsedBits)
ans = 1×3

   936     3     2

parsedBits(1:5,:,:)
ans = 5x3x2 int8 array
ans(:,:,1) =

   1   0   1
   0   1   1
   1   0   1
   0   0   0
   1   0   1


ans(:,:,2) =

   1   1   1
   1   1   1
   0   0   1
   1   1   0
   1   0   0

Get the bit order after the segment parsing of an OFDM symbol of an S1G configuration with a channel bandwidth of 16 MHz, and two spatial streams.

Define the input parameters. Set the channel bandwidth to 16 MHz, the number of coded bits per OFDM symbol to 1872, the number of spatial streams to 2, the number of encoded streams to 1, the number of coded bits per subcarrier per spatial stream to 2 and the number of OFDM symbols to 2. Calculate the number of coded bits per OFDM symbol per spatial stream by dividing the number of coded bits per OFDM symbol by the number of spatial streams.

chanBW = 'CBW16';
numCBPS = 1872;
numSS = 2;
numES = 1;
numBPSCS = 2;
numSym = 1;
numCBPSS = numCBPS/numSS;

Create the input sequence.

sequence = (1:numCBPS*numSym).';
inp = reshape(sequence,numCBPSS*numSym,numSS);

Perform segment parsing on the sequence.

parsedSequence = wlanSegmentParseBits(inp,chanBW,numES,numCBPS,numBPSCS);

The parsed sequence is a three-dimensional array containing the corresponding bit order.

size(parsedSequence)
ans = 1×3

   468     2     2

Input Arguments

collapse all

Input sequence of stream-parsed bits, specified as an (NCBPSS×NSYM)-by-NSS matrix, where:

  • NCBPSS is the number of coded bits per OFDM symbol per spatial stream.

  • NSYM is the number of OFDM symbols.

  • NSS is the number of spatial streams.

Data Types: double | int8

Channel bandwidth in MHz, specified as 'CBW1','CBW2', 'CBW4','CBW8', 'CBW16', 'CBW20', 'CBW40', 'CBW80', or 'CBW160'.

Example: 'CBW160'

Data Types: char | string

Number of encoded streams, specified as an integer from 1 to 9, or 12.

Data Types: double

Number of coded bits per OFDM symbol, specified as a positive integer. When cbw is 'CBW16' or 'CBW160', numCBPS must be an integer equal to 468×NBPSCS×NSS, where:

  • NBPSCS is the number of coded bits per subcarrier per spatial stream.

  • NSS is the number of spatial streams. It accounts for the number of columns (second dimension) of the input bits.

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

Data Types: double

Output Arguments

collapse all

Segment-parsed bits, specified as an (NCBPSSI×NSYM)-by-NSS-by-NSEG array, where:

  • NCBPSSI is the number of coded bits per OFDM symbol per spatial stream per interleaver block.

  • NSYM is the number of OFDM symbols.

  • NSS is the number of spatial streams.

  • NSEG is the number of segments. When cbw is 'CBW16' or 'CBW160', NSEG is 2. Otherwise it is 1.

Extended Capabilities

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

Version History

Introduced in R2017b