Main Content

wlanBCCDecode

BCC-decode input data

Description

y = wlanBCCDecode(sym,rate) returns decoded bits y by convolutionally decoding symbols sym at the decoding rate specified by rate.

example

y = wlanBCCDecode(sym,rate,decType) specifies the decoding type of the Viterbi decoding algorithm.

y = wlanBCCDecode(sym,rate,tDepth) specifies the traceback depth of the Viterbi decoding algorithm.

example

y = wlanBCCDecode(sym,rate,decType,tDepth) specifies the decoding type and the traceback depth. You can specify the decType and tDepth inputs in any order after rate.

example

Examples

collapse all

Create a sequence of data bits.

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

Parse the data bits.

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

Specify a coding rate of 1/2. BCC-encode the parsed sequence.

rate = "1/2";
encodedData = wlanBCCEncode(parsedData,rate);

Convert the encoded bits to soft bits.

demodData = double(1-2*encodedData);

BCC-decode the demodulated data.

decodedData = wlanBCCDecode(demodData,rate);

Deparse the decoded data.

deparsedData = reshape(decodedData.',[],1);

Verify that the decoded data matches the original data.

isequal(dataBits,deparsedData)
ans = logical
   1

Create a sequence of data bits.

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

BCC-encode the sequence of bits.

encodedData = wlanBCCEncode(dataBits,3/4);

Convert the encoded bits to soft bits.

demodData = 1-2*encodedData;

BCC-decode the demodulated bits.

tDepth = 60;
decodedData = wlanBCCDecode(demodData,3/4,tDepth);

Verify that the decoded data matches the original data.

isequal(dataBits,decodedData)
ans = logical
   1

Create a sequence of data bits.

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

BCC-encode the sequence of bits.

encodedData = wlanBCCEncode(dataBits,'2/3');

Specify a traceback depth of 45. Perform hard BCC decoding on the encoded bits.

tDepth = 45;
decodedBits = wlanBCCDecode(encodedData,'2/3','hard',tDepth);

Verify that the decoded bits match the original bits.

isequal(dataBits,decodedBits)
ans = logical
   1

Input Arguments

collapse all

Symbols to decode, specified as a matrix of integers. The number of columns must be the number of encoded streams. Each stream is encoded separately. When you specify the decType input as 'soft', this input must be a real matrix with log-likelihood ratios. Positive values represent a logical 0 and negative values represent a logical 1.

Data Types: single | double | int8

Code rate of the binary convolutional code (BCC), specified as a numeric scalar, character vector, or string scalar. To select a code rate, specify this input as a value in accordance with the 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: single | double | char | string

Decoding type of the BCC, specified as a character vector or a string scalar. To specify a hard input Viterbi algorithm, specify this input as 'hard'. To specify a soft input Viterbi algorithm without any quantization, specify this input as'soft'.

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

Data Types: char | string

Traceback depth of the Viterbi decoding algorithm, specified as a positive integer less than or equal to the number of input symbols in sym.

Data Types: single | double

Output Arguments

collapse all

Binary convolutionally decoded bits, returned as a binary matrix. The number of rows of y is equal to the number of rows of input sym multiplied by rate, rounded to the next integer. The number of columns of y is equal to the number of columns of sym.

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