%% Generate Transform Precoded PUSCH Symbols
% Generate a random sequence of binary values corresponding to a PUSCH codeword of 960 bits.

cw = randi([0 1],960,1);

% Perform PUSCH scrambling initialized with the specified physical layer cell identity number and RNTI.

ncellid = 42;
rnti = 101;
scrambled = nrPUSCHScramble(cw,ncellid,rnti);

% Modulate the scrambled PUSCH codeword by using modulation scheme 16-QAM.

modulation = '16QAM';
modSym = nrSymbolModulate(scrambled,modulation);

% Perform layer mapping using a single transmission layer.

layeredSym = nrLayerMap(modSym,1);

% Generate transform precoded symbols by using an allocated PUSCH bandwidth of 2 resource blocks.

tpSym = nrTransformPrecode(layeredSym,2);

% Copyright 2018 The MathWorks, Inc.