AWGN#
- class sionna.phy.channel.AWGN(precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockAdd complex AWGN to the inputs with a certain variance.
This block adds complex AWGN noise with variance
noto the input. The noise has varianceno/2per real dimension. It can be either a scalar or a tensor which can be broadcast to the shape of the input.- Parameters:
- Inputs:
x – […], torch.complex. Channel input.
no – Scalar or Tensor, torch.float. Scalar or tensor whose shape can be broadcast to the shape of
x. The noise powernois per complex dimension. Ifnois a scalar, noise of the same variance will be added to the input. Ifnois a tensor, it must have a shape that can be broadcast to the shape ofx. This allows, e.g., adding noise of different variance to each example in a batch. Ifnohas a lower rank thanx, thennowill be broadcast to the shape ofxby adding dummy dimensions after the last axis.
- Outputs:
y – Tensor with same shape as
x, torch.complex. Channel output.
Examples
import torch from sionna.phy.channel import AWGN awgn_channel = AWGN() x = torch.randn(64, 16, dtype=torch.complex64) no = 0.1 y = awgn_channel(x, no) print(y.shape) # torch.Size([64, 16])