komm.BlockEncoder
Encoder for linear block codes.
Attributes:
-
code
(BlockCode
) –The block code to be considered.
Input
-
in0
(Array1D[int]
) –The bit sequence to be encoded. Its length must be a multiple of the code's dimension $k$.
Output:
-
out0
(Array1D[int]
) –The encoded bit sequence. Its length is a multiple of the code's block length $n$.
Examples:
>>> code = komm.HammingCode(3)
>>> encoder = komm.BlockEncoder(code)
>>> encoder([1, 1, 0, 0, 1, 0, 1, 1])
array([1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0])