get_pathloss#

sionna.sys.get_pathloss(h_freq: torch.Tensor, rx_tx_association: torch.Tensor | None = None, precision: Literal['single', 'double'] | None = None) Tuple[torch.Tensor, torch.Tensor | None][source]#

Computes the pathloss for each receiver-transmitter pair and, if the receiver-transmitter association is provided, the pathloss between each user and the associated base station.

Parameters:
  • h_freq (torch.Tensor) – OFDM channel matrix.

  • rx_tx_association (torch.Tensor | None) – Its \((i,j)\) element is 1 if receiver \(i\) is attached to transmitter \(j\), 0 otherwise.

  • precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None, precision is used.

Outputs:
  • pathloss_all_pairs – […, num_rx, num_tx, num_ofdm_symbols], torch.float. Pathloss for each RX-TX pair and across OFDM symbols.

  • pathloss_serving_tx – […, num_ut, num_ofdm_symbols], torch.float. Pathloss between each user and the associated base station. Only computed if rx_tx_association is provided as input.

Examples

import torch
from sionna.sys.utils import get_pathloss

# Create a simple channel matrix
h = torch.randn(2, 4, 2, 3, 2, 14, 52, dtype=torch.complex64)
pathloss_all, _ = get_pathloss(h)
print(pathloss_all.shape)
# torch.Size([2, 4, 3, 14])