%% Interleave and Deinterleave UL-SCH
% Perform back-to-back interleaving and deinterleaving of a vector of interleaver input bit indices.
% Create UE-specific and propagation channel configuration structures.

ue.CyclicPrefixUL = 'Normal';
ue.Shortened = 0;
chs.Modulation = 'QPSK';
chs.NLayers = 1;
chs.QdCQI = 0;
chs.QdRI = 0;
chs.QdACK = 0;

%
% There are 288 PUSCH QPSK symbols in two RBs and two bits per symbol for QPSK.

cdata = randi([0 1],2*288,1);
size(cdata)
interleaved = lteULSCHInterleave(ue,chs,cdata);
deinterleaved = lteULSCHDeinterleave(ue,chs,interleaved);
size(deinterleaved)

% The deinterleaved output is the same size as the data prior to interleaving.
% Copyright 2012 The MathWorks, Inc.