Turbo3GPPInterleaver#

class sionna.phy.fec.interleaving.Turbo3GPPInterleaver(inverse: bool = False, axis: int = -1, precision: str | None = None, device: str | None = None, **kwargs)[source]#

Bases: sionna.phy.block.Block

Interleaver for 3GPP Turbo codes.

Interleaver as used in the 3GPP Turbo codes [3GPPTS36212] and, thus, the maximum length is given as 6144 elements (only for the dimension as specified by axis).

Parameters:
  • inverse (bool) – If True, the inverse permutation is performed.

  • axis (int) – The dimension that should be interleaved. First dimension (axis=0) is not allowed.

  • 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:

x – torch.Tensor. 2+D tensor of arbitrary shape and dtype.

Outputs:

x_int – torch.Tensor. 2+D tensor of same shape and dtype as the input x.

Notes

Note that this implementation slightly deviates from the 3GPP standard [3GPPTS36212] in a sense that zero-padding is introduced for cases when the exact interleaver length is not supported by the standard.

Examples

import torch
from sionna.phy.fec.interleaving import Turbo3GPPInterleaver

interleaver = Turbo3GPPInterleaver()
x = torch.arange(40).reshape(1, 40).float()
y = interleaver(x)
print(y.shape)
# torch.Size([1, 40])

Attributes

property axis: int#

Axis to be permuted.

property keep_state: bool#

Always True for the Turbo3GPP interleaver.

Methods

build(input_shape: tuple) None[source]#

Build block and check consistency of dimensions.

Parameters:

input_shape (tuple) – Shape of input tensor.