%% Generate OFDM Modulated Waveform for Specified Sample Rate
% Generate a waveform by performing OFDM modulation of a resource array that contains PDSCH DM-RS symbols.
% Set carrier configuration parameters, specifying 106 RBs in the carrier resource array.

carrier = nrCarrierConfig('NSizeGrid',106);

% Configure PDSCH and generate the corresponding symbols and indices.

p = 4;
pdsch = nrPDSCHConfig('NumLayers',p);
sym = nrPDSCHDMRS(carrier,pdsch);
ind = nrPDSCHDMRSIndices(carrier,pdsch);

% Create a carrier resource array and map the PDSCH symbols.

grid = nrResourceGrid(carrier,p,'OutputDataType','single');
grid(ind) = sym;

% Generate OFDM modulated waveform, specifying the sample rate.

sr = 1e8;
[waveform,info] = nrOFDMModulate(carrier,grid,'SampleRate',sr);

% Copyright 2020 The MathWorks, Inc.