GaussianPriorSource#
- class sionna.phy.fec.utils.GaussianPriorSource(*, precision: str | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockGenerates 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
noor 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:
- Inputs:
output_shape – list of int or torch.Size. Shape of the generated LLR tensor.
no – None (default) | float. Scalar defining the noise variance for the synthetic AWGN channel.
mi – None (default) | float. Scalar defining the mutual information for the synthetic AWGN channel. Only used if
nois None.
- Outputs:
llr – torch.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])