Main Content

wlanBCCDecode

Convolutionally decode input data

Description

example

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

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

example

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.

Examples

collapse all

Decode two encoded streams of soft bits by using a BCC of rate 1/2.

Create the sequence of data bits.

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

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

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

BCC-encode the parsed sequence.

encodedData = wlanBCCEncode(parsedData,'1/2');

Convert the encoded bits to soft bits (i.e. LLR demodulation).

demodData = double(1-2*encodedData);

BCC-decode the demodulated data.

decodedData = wlanBCCDecode(demodData,'1/2');

Deparse the decoded data.

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

Verify that the decoded data matches the original data.

isequal(dataBits,deparsedData)
ans = logical
   1

Decode a sequence of soft bits by using a BCC of rate 3/4 and a traceback depth of 60.

Create the 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 (i.e. LLR demodulation).

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

Decode a sequence of hard bits by using a BCC of rate 3/4 and a traceback depth of 45.

Create the sequence of data bits.

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

BCC-encode the sequence of bits.

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

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

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: 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: double | char | string

Decoding type of the binary convolutional code (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.

Example: y = wlanBCCDecode(sym,'1/2','hard',50)

Data Types: 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™-2016 (Revision of IEEE Std 802.11-2012). “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™.

Introduced in R2017b