Convolutionally encode binary data



y = wlanBCCEncode(bits,rate) convolutionally encodes the binary input bits using a binary convolutional code (BCC) at the specified rate. The BCC is defined in IEEE® 802.11™-2012 Sections and


collapse all

Encode a sequence of data bits by using a BCC of rate 3/4.

Create the sequence of data bits.

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

BCC-encode the data bits.

encodedData = wlanBCCEncode(dataBits,'3/4');
ans = 1×2

   400     1

Encode two streams of data bits by using a BCC of rate 1/2.

Create the sequence of data bits.

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

Parse the sequence of bits as defined in IEEE® 802.11™-2012 Section and IEEE® 802.11ac™-2013 Section numES is the number of encoded streams.

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

BCC-encode the parsed sequence.

encodedData = wlanBCCEncode(parsedData,1/2);
ans = 1×2

   100     2

Input Arguments

collapse all

Input sequence with data bits to encode, specified as a binary matrix. The number of columns must equal the number of encoded streams. Each stream is encoded separately.

Data Types: double | int8

Code rate of the binary convolutional code (BCC), specified as a scalar, character array, or string scalar. rate must be a numeric value equal to 1/2, 2/3, 3/4, or 5/6, or a character vector or string scalar equal to '1/2', '2/3', '3/4', or '5/6'.

Example: '1/2'

Data Types: double | char | string

Output Arguments

collapse all

Binary convolutionally encoded output, returned as a binary matrix of the same type of bits. The number of rows of y is the result of 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.

Extended Capabilities

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

Introduced in R2017b