Skip to content

komm.ReedDecoder

Reed decoder for Reed-Muller codes. It's a majority-logic decoding algorithm. For more details, see [LC04, Sec 4.3 and 10.9.1] for hard-decision decoding, and [LC04, Sec 10.9.2] for soft-decision decoding.

Parameters:

  • code (ReedMullerCode)

    The Reed-Muller code to be used for decoding.

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

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

Notes
  • Input type: hard or soft.
  • Output type: hard.

__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.ReedMullerCode(1, 3)
>>> decoder = komm.ReedDecoder(code, input_type="hard")
>>> decoder([[0, 0, 0, 0, 0, 1, 0, 0], [1, 1, 0, 1, 1, 1, 1, 1]])
array([[0, 0, 0, 0],
       [0, 0, 0, 1]])
>>> code = komm.ReedMullerCode(1, 3)
>>> decoder = komm.ReedDecoder(code, input_type="soft")
>>> decoder([+1.3, +1.0, +0.9, +0.4, -0.8, +0.2, +0.3, +0.8])
array([0, 0, 0, 0])