%% BCC-Decode Hard Bits
% 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)

% Copyright 2012 The MathWorks, Inc.