Main Content

nrResourceGrid

Generate empty carrier slot resource grid

Description

example

grid = nrResourceGrid(carrier) generates an empty carrier slot resource grid for one antenna and the specified carrier configuration parameters.

example

grid = nrResourceGrid(carrier,p) generates an empty carrier slot resource grid for the specified number of antennas.

example

grid = nrResourceGrid(___,'OutputDataType',type) specifies the data type of the generated grid in addition to any combination of input arguments from the previous syntaxes.

Examples

collapse all

Generate a waveform by performing OFDM modulation of a resource array that contains sounding reference signals (SRSs). The resource array spans an entire frame.

Set carrier configuration parameters, specifying a subcarrier spacing of 30 kHz and 24 resource blocks (RBs) in the carrier resource array.

carrier = nrCarrierConfig('SubcarrierSpacing',30,'NSizeGrid',24);

Configure SRS parameters, setting the slot periodicity to 2 and the offset to zero.

srs = nrSRSConfig('SRSPeriod',[2 0]);

Get OFDM information for the specified carrier configuration.

info = nrOFDMInfo(carrier);

Produce the frame resource array by creating and concatenating individual slot resource arrays.

grid = [];
for nslot = 0:(info.SlotsPerFrame - 1)
    carrier.NSlot = nslot;
    slotGrid = nrResourceGrid(carrier);
    ind = nrSRSIndices(carrier,srs);
    sym = nrSRS(carrier,srs);
    slotGrid(ind) = sym;
    grid = [grid slotGrid];
end

Perform OFDM modulation on the resource array for the specified carrier configuration.

[waveform,info] = nrOFDMModulate(carrier,grid);

Recover a transmitted carrier resource array by demodulating an OFDM waveform.

Set carrier configuration parameters, specifying 106 resource blocks (RBs) in the carrier resource array.

carrier = nrCarrierConfig('NSizeGrid',106);

Generate physical downlink shared channel (PDSCH) demodulation reference signal (DM-RS) symbols and indices.

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

Create a carrier resource array containing the PDSCH DM-RS symbols.

txGrid = nrResourceGrid(carrier,p);
txGrid(ind) = sym;

Generate OFDM modulated waveform.

[txWaveform,~] = nrOFDMModulate(carrier,txGrid);

Pass the waveform through a simple 2-by-1 channel.

H = [0.6; 0.4];
waveform = txWaveform*H;

Recover the carrier resource array by demodulating the received OFDM waveform.

grid = nrOFDMDemodulate(carrier,waveform);

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);

Input Arguments

collapse all

Carrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig object. The function uses only these properties of this input.

Number of RBs in the carrier resource grid, specified as an integer from 1 to 275. The default value of 52 corresponds to the maximum number of RBs of a 10 MHz carrier with 15 kHz SCS.

Data Types: double

Cyclic prefix length, specified as one of these options.

  • 'normal' — Use this value to specify normal cyclic prefix. This option corresponds to 14 OFDM symbols in a slot.

  • 'extended' — Use this value to specify extended cyclic prefix. This option corresponds to 12 OFDM symbols in a slot. For the numerologies specified in TS 38.211 Section 4.2, extended cyclic prefix length applies for only 60 kHz subcarrier spacing.

Data Types: char | string

Number of antennas, specified as a positive integer.

Data Types: double

Output data type of generated grid, specified as 'double' or 'single'.

Data Types: char | string

Output Arguments

collapse all

Empty carrier slot resource array, returned as a complex-valued array of size K-by-L-by-p.

  • K is the number of subcarriers.

  • L is the number of OFDM symbols.

Data Types: single | double
Complex Number Support: Yes

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2019b