wlanStreamParse

Stream-parse binary input

Description

example

y = wlanStreamParse(bits,numSS,numCBPS,numBPSCS) parses the encoded bits into spatial streams, as defined in IEEE® 802.11™-2012 Section 20.3.11.8.2 and IEEE 802.11ac™-2013 Section 22.3.10.6.

Examples

collapse all

Stream-parse three OFDM symbols with two encoded streams into five spatial streams.

Define the input parameters. Set the number of coded bits per OFDM symbol to 3240, the number of coded bits per subcarrier per spatial stream to 6, the number of encoded streams to 2, the number of spatial streams to 5 and the number of OFDM symbols to 3.

numCBPS = 3240;
numBPSCS = 6;
numES = 2;
numSS = 5;
numSym = 3;

Create a random sequence of bits.

bits = randi([0 1],numCBPS*numSym/numES,numES,'int8');

Stream-parse the random bits.

parsedData = wlanStreamParse(bits,numSS,numCBPS,numBPSCS);

Verify the size of the parsed bits.

size(parsedData)
ans = 1×2

        1944           5

Get the bit order of an OFDM symbol after stream-parsing it from one encoded stream into three spatial streams.

Define the input parameters. Set the number of coded bits per OFDM symbol to 156, the number of coded bits per subcarrier per spatial stream to 1, the number of encoded streams to 1, the number of spatial streams to 3 and the number of OFDM symbols to 1.

numCBPS = 156;
numBPSCS = 1;
numES = 1;
numSS = 3;
numSym = 1;

Create an input sequence of ordered symbols with the proper dimensions.

sequence = (1:numCBPS*numSym).';
inp = reshape(sequence,numCBPS*numSym/numES,numES)
inp = 156×1

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
      ⋮

Stream-parse the symbols.

parsedData = wlanStreamParse(inp,numSS,numCBPS,numBPSCS)
parsedData = 52×3

     1     2     3
     4     5     6
     7     8     9
    10    11    12
    13    14    15
    16    17    18
    19    20    21
    22    23    24
    25    26    27
    28    29    30
      ⋮

Input Arguments

collapse all

Input sequence of encoded bits, specified as a (NCBPS×NSYM/NES)-by-NES matrix, where:

  • NCBPS is the number of coded bits per OFDM symbol.

  • NSYM is the number of OFDM symbols.

  • NES is the number of encoded streams.

Data Types: double | int8

Number of spatial streams (NSS), specified as an integer from 1 to 8.

Data Types: double

Number of coded bits per OFDM symbol, specified as an integer equal to (NBPSCS×NSS×NSD), where:

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

  • NSS is the number of spatial streams.

  • NSD is the number of complex data numbers per frequency segment, specified as 24, 52, 108, 234, or 468.

Data Types: double

Number of coded bits per subcarrier per spatial stream, specified as 1, 2, 4, 6, or 8.

Data Types: double

Output Arguments

collapse all

Stream-parsed output data, returned 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.

Extended Capabilities

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

Introduced in R2017b