%% Decode SL-BCH Codeword
% Decode a sidelink broadcast channel (SL-BCH) codeword.
% Create a UE-specific configuration structure with normal cyclic prefix.

ue.CyclicPrefixSL = 'Normal';

%
% Generate an SL-BCH codeword by using an MIB-SL transport block of all ones. Display the CRC result.

trblk = ones(40,1);
slbchCoded = lteSLBCH(ue,trblk);
[slbchDecoded,err] = lteSLBCHDecode(ue,slbchCoded);
err

%
% The CRC result indicates no error. isequal reconfirms the decoded output matches the input transport block.

isequal(slbchDecoded,trblk)

% Copyright 2012 The MathWorks, Inc.