Stream-parse binary input
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
⋮
bits
— Input sequenceInput 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
numSS
— Number of spatial streamsNumber of spatial streams (NSS), specified as an integer from 1 to 8.
Data Types: double
numCBPS
— Number of coded bits per OFDM symbolNumber 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
numBPSCS
— Number of coded bits per subcarrier per spatial streamNumber of coded bits per subcarrier per spatial stream, specified as 1, 2, 4, 6, or 8.
Data Types: double
y
— Stream-parsed outputStream-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.
You have a modified version of this example. Do you want to open this example with your edits?