FlatFadingChannel#
- class sionna.phy.channel.FlatFadingChannel(num_tx_ant: int, num_rx_ant: int, spatial_corr: sionna.phy.channel.spatial_correlation.SpatialCorrelation | None = None, return_channel: bool = False, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockApplies random channel matrices to a vector input and adds AWGN
This class combines
GenerateFlatFadingChannelandApplyFlatFadingChanneland computes the output of a flat-fading channel with AWGN.For a given batch of input vectors \(\mathbf{x}\in\mathbb{C}^{K}\), the output is
\[\mathbf{y} = \mathbf{H}\mathbf{x} + \mathbf{n}\]where \(\mathbf{H}\in\mathbb{C}^{M\times K}\) are randomly generated flat-fading channel matrices and \(\mathbf{n}\in\mathbb{C}^{M}\sim\mathcal{CN}(0, N_o\mathbf{I})\) is an AWGN vector that is optionally added.
A
SpatialCorrelationcan be configured and the channel realizations optionally returned. This is useful to simulate receiver algorithms with perfect channel knowledge.- Parameters:
num_tx_ant (int) – Number of transmit antennas
num_rx_ant (int) – Number of receive antennas
spatial_corr (sionna.phy.channel.spatial_correlation.SpatialCorrelation | None) – Spatial correlation to be applied. Defaults to None.
return_channel (bool) – Indicates if the channel realizations should be returned. Defaults to False.
precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation (e.g., ‘cpu’, ‘cuda:0’). If None,
deviceis used.
- Inputs:
x – [batch_size, num_tx_ant], torch.complex. Tensor of transmit vectors.
no – None (default) | torch.Tensor, torch.float. (Optional) noise power
noper complex dimension. Will be broadcast to the shape ofy. For more details, seeAWGN.
- Outputs:
y – [batch_size, num_rx_ant], torch.complex. Channel output.
h – [batch_size, num_rx_ant, num_tx_ant], torch.complex. Channel realizations. Will only be returned if
return_channel==True.
Examples
import torch from sionna.phy.channel import FlatFadingChannel chn = FlatFadingChannel(num_tx_ant=4, num_rx_ant=16, return_channel=True) x = torch.randn(32, 4, dtype=torch.complex64) y, h = chn(x) print(y.shape) # torch.Size([32, 16]) print(h.shape) # torch.Size([32, 16, 4])
Attributes
- property spatial_corr: sionna.phy.channel.spatial_correlation.SpatialCorrelation | None#
Get/set spatial correlation to be applied
- property generate: sionna.phy.channel.flat_fading_channel.GenerateFlatFadingChannel#
Access the internal
GenerateFlatFadingChannel
- property apply: sionna.phy.channel.flat_fading_channel.ApplyFlatFadingChannel#
Access the internal
ApplyFlatFadingChannel