PUSCHPrecoder#
- class sionna.phy.nr.PUSCHPrecoder(precoding_matrices: List, precision: str | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockPrecodes a batch of modulated symbols mapped onto a resource grid for PUSCH transmissions.
Each transmitter is assumed to have its own precoding matrix.
- Parameters:
precoding_matrices (List) – List of precoding matrices, one for each transmitter. All precoding matrices must have the same shape. Shape: [num_tx, num_antenna_ports, num_layers].
precision (str | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation.
- Inputs:
inputs – [batch_size, num_tx, num_layers, num_symbols_per_slot, num_subcarriers], torch.complex. Batch of resource grids to be precoded.
- Outputs:
x_precoded – [batch_size, num_tx, num_antenna_ports, num_symbols_per_slot, num_subcarriers], torch.complex. Batch of precoded resource grids.
Examples
import torch import numpy as np from sionna.phy.nr import PUSCHPrecoder # Create precoding matrices for 2 transmitters, 2 antenna ports, 1 layer w1 = np.array([[1], [0]], dtype=complex) / np.sqrt(2) w2 = np.array([[1], [1]], dtype=complex) / 2 precoding_matrices = [w1, w2] precoder = PUSCHPrecoder(precoding_matrices) x = torch.randn(4, 2, 1, 14, 48, dtype=torch.complex64) y = precoder(x) print(y.shape) # torch.Size([4, 2, 2, 14, 48])
Methods