%% Generate PRACH OFDM Modulated Waveform
% Generate a PRACH waveform by performing OFDM modulation of a resource array that contains PRACH symbols.
% Specify carrier configuration parameters.

carrier = nrCarrierConfig;

% Configure PRACH for format A1.

prach = nrPRACHConfig('ConfigurationIndex',106,'SubcarrierSpacing',15);

% Generate PRACH symbols and map to a PRACH slot resource grid.

sym = nrPRACH(carrier,prach);
ind = nrPRACHIndices(carrier,prach);
grid = nrPRACHGrid(carrier,prach);
grid(ind) = sym;

% Generate the PRACH OFDM waveform by modulating the grid. Display PRACH OFDM information.

[waveform,info] = nrPRACHOFDMModulate(carrier,prach,grid);
disp(info)

% Copyright 2020 The MathWorks, Inc.