%% Three-tone NB-IoT Uplink SC-FDMA Processing Chain
%  Three-tone NB-IoT uplink SC-FDMA processing chain: symbol mapping, UL precoding, and SC-FDMA modulation.

NSlots = 10; % Number of slots in the generated waveform
ue.NBULSubcarrierSpacing = '15kHz'; % NB-IoT with subcarrier spacing 15kHz
chs.NBULSubcarrierSet = 0:2; % Subcarrier locations
bits = randi([0,1],7*NSlots*length(chs.NBULSubcarrierSet)*2,1);
symbols = lteSymbolModulate(bits,'QPSK');
precodedSymbols = lteULPrecode(symbols,length(chs.NBULSubcarrierSet),'Subcarrier');
reGrid = zeros([12 7*NSlots]); % Initialize the grid
reGrid(chs.NBULSubcarrierSet+1,:) = reshape(precodedSymbols,length(chs.NBULSubcarrierSet),7*NSlots);
waveform = lteSCFDMAModulate(ue,chs,reGrid);
waveform = waveform(1:5)

% Copyright 2018 The MathWorks, Inc.