komm.GaussianEliminationDecoder
Gaussian elimination decoder for general block codes over the binary erasure channel. This decoder performs bit-wise MAP decoding: it solves the linear system relating the erased positions to the received ones, and returns the bits shared by all its solutions. For more details, see RU08, Sec. 3.2.
Parameters:
-
code(BlockCode) –The block code to be used for decoding.
Notes
- Input type:
erasure(bits, with2denoting an erasure). - Output type:
erasure(bits, with2denoting 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.GaussianEliminationDecoder(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, but still recoverable
array([1, 1, 0, 0, 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.
Examples:
>>> code = komm.HammingCode(3)
>>> decoder = komm.GaussianEliminationDecoder(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, but still recoverable
array([1, 1, 0, 0])
>>> decoder.decode([1, 0, 2, 1, 2, 2, 2])
array([1, 0, 2, 1])