Main Content

nrResourceGrid

Generate empty carrier slot resource grid

Since R2020b

Description

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',datatype) specifies the data type of the generated grid in addition to the input arguments in any of the previous syntaxes.

example

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. This function uses only these properties of the nrCarrierConfig object.

Number of antennas, specified as a positive integer.

Data Types: double

Data type of the output symbols, 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

Version History

Introduced in R2020b