Skip to content

komm.BCJRDecoder

Bahl–Cocke–Jelinek–Raviv (BCJR) decoder for terminated convolutional codes. For more details, see LC04, Sec. 12.6.

Parameters:

  • code (TerminatedConvolutionalCode)

    The terminated convolutional code to be used for decoding.

  • output_type (Literal['hard', 'soft'])

    The type of the output. Either 'hard' or 'soft'. Default is 'soft'.

Notes
  • Input type: soft (L-values).
  • Output type: hard (bits) or soft (L-values).

__call__()

Decode received words. This method takes one or more sequences of received words and returns their corresponding estimated message sequences.

Parameters:

  • input (ArrayLike)

    The input sequence(s). Can be either a single sequence whose length is a multiple of $n$, or a multidimensional array where the last dimension is a multiple of $n$.

Returns:

  • output (NDArray[integer | floating])

    The output sequence(s). Has the same shape as the input, with the last dimension contracted from $bn$ to $bk$, where $b$ is a positive integer.

Examples:

>>> convolutional_code = komm.ConvolutionalCode(
...     feedforward_polynomials=[[0b11, 0b1]],
...     feedback_polynomials=[0b11],
... )
>>> code = komm.TerminatedConvolutionalCode(
...     convolutional_code,
...     num_blocks=3,
...     mode="zero-termination",
... )
>>> decoder = komm.BCJRDecoder(code)
>>> decoder([-0.8, -0.1, -1.0, +0.5, +1.8, -1.1, -1.6, +1.6])
array([-0.47774884, -0.61545527,  1.03018771])
>>> decoder = komm.BCJRDecoder(code, output_type="hard")
>>> decoder([-0.8, -0.1, -1.0, +0.5, +1.8, -1.1, -1.6, +1.6])
array([1, 1, 0])