%% Generate NPUSCH DRS Symbols
% Generate NPUSCH DRS symbols for a single-tone data channel.
% Configure UE-specific settings.

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

% Specify a channel transmission configuration.

chs = struct('NPUSCHFormat','Data','NRep',2,'NRU',1,'NRUsc',1, ...
    'NULSlots',16,'SeqGroupHopping','On','SeqGroup',0);

% Specify the initial encoder state as an empty structure, indicating the start of a bundle.

stateIn  = struct();

% Generate NPUSCH DRS symbols.

for SlotIdx = 0:(chs.NRep*chs.NRU*chs.NULSlots-1)
    ue.NSlot = SlotIdx;
    [sym,stateOut] = lteNPUSCHDRS(ue,chs,stateIn);
    stateIn = stateOut;
end

% Confirming that the transmission reaches the end of the bundle.

disp(stateOut.EndOfTx)

% Copyright 2019 The MathWorks, Inc.