Trellis#

class sionna.phy.fec.conv.utils.Trellis(gen_poly: Tuple[str, ...], rsc: bool = False, device: str = None)[source]#

Bases: object

Trellis structure for a given generator polynomial.

Defines state transitions and output symbols (and bits) for each current state and input.

Parameters:
  • gen_poly (Tuple[str, ...]) – Sequence of strings with each string being a 0,1 sequence. If rsc is True, the first polynomial will act as denominator for the remaining generator polynomials. For example, rsc = True and gen_poly = ('111', '101', '011') implies generator matrix equals \(G(D)=[\frac{1+D^2}{1+D+D^2}, \frac{D+D^2}{1+D+D^2}]\). Currently Trellis is only implemented for generator matrices of size \(\frac{1}{n}\).

  • rsc (bool) – Boolean flag indicating whether the Trellis is recursive systematic or not. If True, the encoder is recursive systematic in which case the first polynomial in gen_poly is used as the feedback polynomial. Defaults to False.

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

Examples

from sionna.phy.fec.conv import Trellis

trellis = Trellis(gen_poly=('101', '111'))
print(f"Number of states: {trellis.ns}")
# Number of states: 4

Attributes

property device: str#

Device on which trellis tensors reside.

property mu: int#

Memory (constraint length - 1) of the convolutional code.

Methods

to(device: str) sionna.phy.fec.conv.utils.Trellis[source]#

Moves all tensors to the specified device.

Parameters:

device (str) – Target device (e.g., ‘cpu’, ‘cuda:0’).

Outputs:

trellis – Self reference for chaining.