AWGN#

class sionna.phy.channel.AWGN(precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#

Bases: sionna.phy.block.Block

Add complex AWGN to the inputs with a certain variance.

This block adds complex AWGN noise with variance no to the input. The noise has variance no/2 per real dimension. It can be either a scalar or a tensor which can be broadcast to the shape of the input.

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

  • device (str | None) – Device for computation. If None, device is used.

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 power no is per complex dimension. If no is a scalar, noise of the same variance will be added to the input. If no is a tensor, it must have a shape that can be broadcast to the shape of x. This allows, e.g., adding noise of different variance to each example in a batch. If no has a lower rank than x, then no will be broadcast to the shape of x by 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])