%% Scramble and Descramble PUSCH Vector
% Perform scrambling and descrambling of vector in. The scrambled bits are modulated to QPSK symbols. Noise is added to these symbols, which are then demodulated to produce soft bits. These soft bits are finally descrambled.

in = ones(10,1);
ue = struct('NCellID',100,'NSubframe',0,'RNTI',61);
scrBits = lteULScramble(ue,in);
txSymbols = lteSymbolModulate(scrBits,'QPSK');
noise = 0.01*complex(randn(size(txSymbols)),randn(size(txSymbols)));
rxSymbols = txSymbols + noise;
softBits = lteSymbolDemodulate(rxSymbols,'QPSK','Soft');
descram = lteULDescramble(ue,softBits)

% Copyright 2012 The MathWorks, Inc.