ResourceGridDemapper#
- class sionna.phy.ofdm.ResourceGridDemapper(resource_grid: sionna.phy.ofdm.resource_grid.ResourceGrid, stream_management: sionna.phy.mimo.stream_management.StreamManagement, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockExtracts data-carrying resource elements from a resource grid.
This block takes as input an OFDM
ResourceGridand extracts the data-carrying resource elements. In other words, it implements the reverse operation ofResourceGridMapper.- Parameters:
resource_grid (sionna.phy.ofdm.resource_grid.ResourceGrid) –
ResourceGridto be usedstream_management (sionna.phy.mimo.stream_management.StreamManagement) –
StreamManagementto be usedprecision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for tensor operations. If None,
deviceis used.
- Inputs:
y – [batch_size, num_rx, num_streams_per_rx, num_ofdm_symbols, fft_size, data_dim], torch.complex. Full OFDM resource grid in the frequency domain. The last dimension
data_dimis optional. Ifdata_dimis used, it refers to the dimensionality of the data that should be demapped to individual streams. An example would be LLRs.- Outputs:
y – [batch_size, num_rx, num_streams_per_rx, num_data_symbols, data_dim], torch.complex. The data that were mapped into the resource grid. The last dimension
data_dimis only returned if it was used for the input.
Examples
import numpy as np from sionna.phy.ofdm import (ResourceGrid, ResourceGridMapper, ResourceGridDemapper) from sionna.phy.mimo import StreamManagement from sionna.phy.mapping import QAMSource rg = ResourceGrid(num_ofdm_symbols=14, fft_size=64, subcarrier_spacing=30e3) sm = StreamManagement(np.ones([1, 1]), 1) mapper = ResourceGridMapper(rg) demapper = ResourceGridDemapper(rg, sm) qam = QAMSource(4) x = qam([32, 1, 1, rg.num_data_symbols]) rg_mapped = mapper(x) x_hat = demapper(rg_mapped) print(x_hat.shape) # torch.Size([32, 1, 1, 896])