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.Block

Extracts data-carrying resource elements from a resource grid.

This block takes as input an OFDM ResourceGrid and extracts the data-carrying resource elements. In other words, it implements the reverse operation of ResourceGridMapper.

Parameters:
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_dim is optional. If data_dim is 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_dim is 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])