%% Generate PUSCH DM-RS Symbols for CP-OFDM
% Create a carrier configuration object with default properties. This object corresponds to a 10 MHz carrier with 15 kHz subcarrier spacing.

carrier = nrCarrierConfig;

% Create a physical uplink shared channel (PUSCH) configuration object with specified properties. When transform precoding is set to 0, the waveform type is cyclic-prefix orthogonal frequency division multiplexing (CP-OFDM).

pusch = nrPUSCHConfig;
pusch.TransformPrecoding = 0;
pusch.TransmissionScheme = 'codebook';
pusch.NumAntennaPorts = 4;
pusch.TPMI = 0;

% Configure PUSCH demodulation reference signal (DM-RS) with specified parameters.

pusch.DMRS.DMRSAdditionalPosition = 1;
pusch.DMRS.DMRSTypeAPosition = 2;
pusch.DMRS.DMRSPortSet = 2;
pusch.DMRS.NIDNSCID = 10;
pusch.DMRS.NSCID = 1;

% Generate DM-RS symbols associated with PUSCH of single data type.

sym = nrPUSCHDMRS(carrier,pusch,'OutputDataType','single')

% Copyright 2019 The MathWorks, Inc.