ResourceGridMapper#

class sionna.phy.ofdm.ResourceGridMapper(resource_grid: sionna.phy.ofdm.resource_grid.ResourceGrid, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#

Bases: sionna.phy.block.Block

Maps a tensor of modulated data symbols to a ResourceGrid.

This layer takes as input a tensor of modulated data symbols and maps them together with pilot symbols onto an OFDM ResourceGrid. The output can be converted to a time-domain signal with the OFDMModulator or further processed in the frequency domain.

Parameters:
Inputs:

inputs – [batch_size, num_tx, num_streams_per_tx, num_data_symbols], torch.complex. Modulated data symbols to be mapped onto the resource grid.

Outputs:

template – [batch_size, num_tx, num_streams_per_tx, num_ofdm_symbols, fft_size], torch.complex. Full OFDM resource grid in the frequency domain.

Examples

import torch
from sionna.phy.ofdm import ResourceGrid, ResourceGridMapper
from sionna.phy.mapping import QAMSource

rg = ResourceGrid(num_ofdm_symbols=14,
                  fft_size=64,
                  subcarrier_spacing=30e3)
mapper = ResourceGridMapper(rg)
qam = QAMSource(4)

# Generate data symbols
x = qam([32, 1, 1, rg.num_data_symbols])
# Map to resource grid
rg_mapped = mapper(x)
print(rg_mapped.shape)
# torch.Size([32, 1, 1, 14, 64])