RZFPrecodedChannel#
- class sionna.phy.ofdm.RZFPrecodedChannel(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.ofdm.precoding.PrecodedChannelCompute the effective channel after RZF precoding.
The precoding matrices are obtained from
rzf_precoding_matrix().- Parameters:
resource_grid (sionna.phy.ofdm.ResourceGrid) – ResourceGrid to be used
stream_management (sionna.phy.mimo.StreamManagement) – StreamManagement to be used
precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation. If None,
deviceis used.
- Inputs:
h – [batch_size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, fft_size], torch.complex. Actual channel realizations.
tx_power – [batch_size, num_tx, num_streams_per_tx, num_ofdm_symbols, fft_size] (or first n dims), torch.float. Power of each stream for each transmitter.
h_hat – None (default) | [batch_size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, fft_size], torch.complex. Channel knowledge based on which the precoding is computed. If set to None, the actual channel realizations are used.
alpha – 0. (default) | [batch_size, num_tx, num_ofdm_symbols, fft_size] (or first n dims), float. Regularization parameter for RZF precoding. If set to 0, RZF is equivalent to ZF precoding.
- Outputs:
h_eff – [batch_size, num_rx, num_rx_ant, num_tx, num_streams_per_tx, num_ofdm_symbols, num_effective_subcarriers], torch.complex. The effective channel after precoding. Nulled subcarriers are automatically removed.
Examples
import numpy as np import torch from sionna.phy.ofdm import ResourceGrid, RZFPrecodedChannel from sionna.phy.mimo import StreamManagement num_tx = 2 num_rx_per_tx = 2 num_rx = num_tx * num_rx_per_tx num_streams_per_rx = 2 num_streams_per_tx = num_rx_per_tx * num_streams_per_rx rx_tx_association = np.zeros((num_rx, num_tx), dtype=np.int32) for j in range(num_tx): rx_tx_association[j*num_rx_per_tx:(j+1)*num_rx_per_tx, j] = 1 sm = StreamManagement(rx_tx_association, num_streams_per_tx) rg = ResourceGrid(num_ofdm_symbols=14, fft_size=64, subcarrier_spacing=15e3, num_tx=num_tx, num_streams_per_tx=num_streams_per_tx) precoded_channel = RZFPrecodedChannel(rg, sm) batch_size = 16 h = torch.randn(batch_size, num_rx, num_streams_per_rx, num_tx, num_streams_per_tx * 2, 14, 64, dtype=torch.complex64) tx_power = torch.rand(batch_size, num_tx, num_streams_per_tx, 14, 64) h_eff = precoded_channel(h, tx_power, alpha=0.1) print(h_eff.shape) # torch.Size([16, 4, 2, 2, 4, 14, 64])