%% Scramble UCI bits
% Scramble the encoded UCI bits representing RI=3 using 2 bits. According to Table 5.2.2.6-6 in TS 36.212 this maps to the set of input bits [1; 0].
% Create user-specific configuration structure. Generate a UCI codeword and a pseudorandom scrambling sequence for the PUCCH2 the same length as the codeword.

ue.NCellID = 1;
ue.NSubframe = 0;
ue.RNTI = 1;
cw = lteUCIEncode([1;0]);
seq = ltePUCCH2PRBS(ue,length(cw));
size(seq)

%
% Scramble the UCI codeword using the generated scrambling sequence.

scrambled = xor(seq,cw);

% Copyright 2012 The MathWorks, Inc.