Skip to content

komm.SingleParityCheckDecoder

Soft-in soft-out decoder for single parity-check codes. where $$ f(x) = \log \left( \tanh \left| \frac{x}{2} \right| \right). $$

Parameters:

  • code (SingleParityCheckCode)

    The single parity-check 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).

extrinsic_lvalues()

Examples:

>>> code = komm.SingleParityCheckCode(3)
>>> decoder = komm.SingleParityCheckDecoder(code)
>>> decoder.extrinsic_lvalues([2.0410, 3.9816, 12.0710]).round(3)
array([3.981, 2.041, 1.909])

decode()

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.SingleParityCheckCode(3)
>>> decoder = komm.SingleParityCheckDecoder(code)
>>> decoder.decode([2.041, 3.982, 12.071]).round(3)
array([6.023, 6.023])
>>> decoder = komm.SingleParityCheckDecoder(code, output_type="hard")
>>> decoder.decode([2.041, 3.982, 12.071])
array([0, 0])