Main Content

wlanBCCEncode

BCC-encode data

Description

y = wlanBCCEncode(bits,rate) encodes the binary input bits using a binary convolutional code (BCC) at the rate you specify.

example

Examples

collapse all

Create a sequence of 300 data bits.

dataBits = randi([0 1],300,1);

Specify a code rate. BCC-encode the data bits.

rate = '3/4';
encodedData = wlanBCCEncode(dataBits,rate);

Display the size of the output. It is a column vector of length 400 because your initial sequence had 300 bits and you chose a code rate of 3/4.

disp(size(encodedData))
   400     1

Create a sequence of data bits.

dataBits = randi([0 1],100,1,"int8");

Specify a number of encoded streams. Parse the sequence of bits.

numES = 2;
parsedData = reshape(dataBits,numES,[]).';

BCC-encode the parsed sequence. Display the size of the output.

rate = 1/2;
encodedData = wlanBCCEncode(parsedData,rate);
disp(size(encodedData))
   100     2

Input Arguments

collapse all

Bits to encode, specified as a binary matrix. The number of columns must equal the number of encoded streams. The function encodes each stream separately.

For more information on BCC, see Sections 17.3.5.6 and 19.3.11.6 in [1].

Data Types: double | int8

Code rate of the BCC, specified as a numeric scalar, character vector, or string scalar. To choose a code rate, specify this input as one of the values from this table.

Code RateScalarCharacter VectorString
1/21/2'1/2'"1/2"
2/32/3'2/3'"2/3"
3/43/4'3/4'"3/4"
5/65/6'5/6'"5/6"

Example: '3/4'

Data Types: double | char | string

Output Arguments

collapse all

Binary convolutionally encoded output, returned as a binary matrix of the same type as the bits input. The function gets the number of rows of y by dividing the number of rows of input bits by rate, rounded to the next integer. The number of columns of y is equal to the number of columns of bits.

Data Types: double | 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

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

Version History

Introduced in R2017b