GaussianPriorSource#

class sionna.phy.fec.utils.GaussianPriorSource(*, precision: str | None = None, device: str | None = None, **kwargs)[source]#

Bases: sionna.phy.block.Block

Generates synthetic Log-Likelihood Ratios (LLRs) for Gaussian channels.

Generates synthetic Log-Likelihood Ratios (LLRs) as if an all-zero codeword was transmitted over a Binary Additive White Gaussian Noise (Bi-AWGN) channel. The LLRs are generated based on either the noise variance no or mutual information. If mutual information is used, it represents the information associated with a binary random variable observed through an AWGN channel.

The generated LLRs follow a Gaussian distribution with parameters:

\[\sigma_{\text{llr}}^2 = \frac{4}{\sigma_\text{ch}^2}\]
\[\mu_{\text{llr}} = \frac{\sigma_\text{llr}^2}{2}\]

where \(\sigma_\text{ch}^2\) is the noise variance specified by no.

If the mutual information is provided as input, the J-function as described in [Brannstrom] is used to relate the mutual information to the corresponding LLR distribution.

Parameters:
  • precision (str | None) – Precision used for internal calculations and outputs. If None, precision is used.

  • device (str | None) – Device for computation (e.g., ‘cpu’, ‘cuda:0’). If None, device is used.

Inputs:
  • output_shapelist of int or torch.Size. Shape of the generated LLR tensor.

  • noNone (default) | float. Scalar defining the noise variance for the synthetic AWGN channel.

  • miNone (default) | float. Scalar defining the mutual information for the synthetic AWGN channel. Only used if no is None.

Outputs:

llrtorch.Tensor. Tensor with shape defined by output_shape.

Examples

from sionna.phy.fec.utils import GaussianPriorSource

source = GaussianPriorSource()
llrs = source([1000], no=1.0)
print(llrs.shape)
# torch.Size([1000])