%% Generate PUSCH Indices for Codebook-Based Transmission
% 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 PUSCH configuration object with codebook-based transmission. Set the number of antenna ports to 4, modulation scheme to pi/2-BPSK, transmitted precoding matrix indicator to 10, and transform precoding to 0. When transform precoding is 0, the waveform type is cyclic-prefix orthogonal frequency division multiplexing (CP-OFDM).

pusch = nrPUSCHConfig;
pusch.TransformPrecoding = 0;
pusch.Modulation = 'pi/2-BPSK';
pusch.TransmissionScheme = 'codebook';
pusch.NumAntennaPorts = 4;
pusch.TPMI = 10;

% Generate PUSCH indices in subscript form.

[ind,info] = nrPUSCHIndices(carrier,pusch,'IndexStyle','subscript')

% Copyright 2019 The MathWorks, Inc.