Contenuto principale

nrResourceGrid

Generate empty carrier slot resource grid

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(___,Name=Value) specifies options by using one or more name-value arguments 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

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: OutputDataType='single' specifies single data type for the output symbols.

Data type of the output symbols, specified as 'double' or 'single'.

Data Types: char | string

Since R2026a

Enable GPU processing, specified as one of these values:

  • 'off' — The function executes on the CPU.

  • 'on' — The function executes on the GPU and returns the output grid as a gpuArray (Parallel Computing Toolbox) object on the GPU.

  • 'auto' — If a GPU is available, the function automatically executes on the GPU and returns the output grid as a gpuArray object on the GPU. If no GPUs are available, the function executes on the CPU.

To use a GPU to accelerate computations in MATLAB®, you must have Parallel Computing Toolbox™ and a supported GPU device. For more information on supported devices, see GPU Computing Requirements (Parallel Computing Toolbox) .

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

expand all

Version History

Introduced in R2020b

expand all