Skip to content

komm.PeelingDecoder

Peeling decoder for general block codes over the binary erasure channel. This decoder resolves erased positions one at a time, from parity checks with a single erased position, and stops when none is left. For more details, see RU08, Sec. 3.19.

Parameters:

  • code (BlockCode)

    The block code to be used for decoding.

Notes
  • Input type: erasure (bits, with 2 denoting an erasure).
  • Output type: erasure (bits, with 2 denoting an undetermined position).

decode_to_codeword()

Decode received words to codewords. This method takes one or more sequences of received words and returns their corresponding estimated codeword 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])

    The output sequence(s). Has the same shape as the input.

Examples:

>>> code = komm.HammingCode(3)
>>> decoder = komm.PeelingDecoder(code)
>>> decoder.decode_to_codeword([2, 1, 0, 2, 2, 1, 1])
array([1, 1, 0, 0, 0, 1, 1])
>>> decoder.decode_to_codeword([2, 2, 0, 2, 0, 1, 1])  # Stopping set: peeling stalls
array([2, 2, 0, 2, 0, 1, 1])
>>> decoder.decode_to_codeword([1, 0, 2, 1, 2, 2, 2])
array([1, 0, 2, 1, 0, 2, 2])

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])

    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.

Note

For this decoder, the message is read off from the resolved positions through a right inverse of the generator matrix; message bits that depend on an unresolved position are marked as erasures.

Examples:

>>> code = komm.HammingCode(3)
>>> decoder = komm.PeelingDecoder(code)
>>> decoder.decode([2, 1, 0, 2, 2, 1, 1])
array([1, 1, 0, 0])
>>> decoder.decode([2, 2, 0, 2, 0, 1, 1])  # Stopping set: peeling stalls
array([2, 2, 0, 2])
>>> decoder.decode([1, 0, 2, 1, 2, 2, 2])
array([1, 0, 2, 1])