%% Generate NB-IoT UL-SCH Data Codeword
% Generate a codeword by applying NB-IoT UL-SCH data processing to a transport block.
% Configure UE-specific settings.

ue = struct('NBULSubcarrierSpacing','15kHz');

% Specify a channel transmission configuration.

chs =  struct('NPUSCHFormat','Data','NULSlots',16,'NBULSubcarrierSet',6, ...
    'Modulation','BPSK','NRU',2,'RV',0);

% Specify the codeword length and create a transport block for encoding.

[~,info] = lteNPUSCHIndices(ue,chs);
outLen = info.G;
trBlkIn = randi([0,1],144,1);

% Generate the UL-SCH codeword.

cw = lteNULSCH(chs,outLen,trBlkIn);

% Copyright 2019 The MathWorks, Inc.