Skip to content

komm.SCDecoder

Successive cancellation decoder for Polar codes.

Parameters:

  • code (PolarCode)

    The Polar 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:

>>> code = komm.PolarCode(3, [0, 1, 2, 4])
>>> decoder = komm.SCDecoder(code)
>>> decoder([1, -4, -3, 2, -2, 3, 4, -1])
array([ -6.84595089,  -5.96379094,  -9.30685282, -20.        ])
>>> decoder = komm.SCDecoder(code, output_type="hard")
>>> decoder([1, -4, -3, 2, -2, 3, 4, -1])
array([1, 1, 1, 1])