%% Decode PSCCH Symbols
% Decode PSCCH symbols that contain a fully encoded SCI format 0 message with noise added. After PSCCH demodulation, decode and recover the SCI message structure.
% Create UE settings and SCI message configuration structures. Generate a PSCCH transmission. Add noise to the symbols.

ue = struct('NSLRB',50,'CyclicPrefixSL','Normal');
sci0 = struct('FreqHopping',1,'ModCoding',3);

[sci0,scibits] = lteSCI(ue,sci0);
cw = lteSCIEncode(ue,scibits);
sym = ltePSCCH(cw);

rxsym = sym + 0.1*randn(size(sym));

%
% Decode the PSCCH symbols and SCI message. View the SCI message structure settings. Confirm that the transmitted and recovered SCI messages match.

[rxsoftbits,sym] = ltePSCCHDecode(rxsym);
[rxinfo,rxerr] = lteSCIDecode(ue,rxsoftbits);

[recsci0,recscibits] = lteSCI(ue,rxinfo);
recsci0

isequal(scibits,recscibits)

% Copyright 2012 The MathWorks, Inc.