hard_decisions#

sionna.phy.utils.hard_decisions(llr: torch.Tensor) torch.Tensor[source]#

Transforms LLRs into hard decisions.

Positive values are mapped to \(1\). Nonpositive values are mapped to \(0\).

Parameters:

llr (torch.Tensor) – Tensor of LLRs (must be non-complex dtype).

Outputs:

b – Hard decisions with the same shape and dtype as llr.

Examples

import torch
from sionna.phy.utils import hard_decisions

llr = torch.tensor([-1.5, 0.0, 2.3, -0.1])
print(hard_decisions(llr))
# tensor([0., 0., 1., 0.])