komm.SystematicBlockCode
Systematic linear block code. A systematic linear block code is a linear block code in which the information bits can be found in predefined positions in the codeword, called the information set $\mathcal{K}$, which is a $k$-sublist of $[0 : n)$; the remaining positions are called the parity set $\mathcal{M}$, which is a $m$-sublist of $[0 : n)$. In this case, the generator matrix then has the property that the columns indexed by $\mathcal{K}$ are equal to $I_k$, and the columns indexed by $\mathcal{M}$ are equal to $P$. The check matrix has the property that the columns indexed by $\mathcal{M}$ are equal to $I_m$, and the columns indexed by $\mathcal{K}$ are equal to $P^\transpose$. The matrix $P \in \mathbb{B}^{k \times m}$ is called the parity submatrix of the code.
The constructor expects the parity submatrix and the information set.
Attributes:
-
parity_submatrix
(NDArray[integer]
) –The parity submatrix $P$ the code, which is a $k \times m$ binary matrix.
-
information_set
(NDArray[integer]
) –Either an array containing the indices of the information positions, which must be a $k$-sublist of $[0 : n)$, or one of the strings
'left'
or'right'
. The default value is'left'
.
Examples:
>>> code = komm.SystematicBlockCode(parity_submatrix=[[0, 1, 1], [1, 1, 0]])
>>> (code.length, code.dimension, code.redundancy)
(5, 2, 3)
>>> code.generator_matrix
array([[1, 0, 0, 1, 1],
[0, 1, 1, 1, 0]])
>>> code.check_matrix
array([[0, 1, 1, 0, 0],
[1, 1, 0, 1, 0],
[1, 0, 0, 0, 1]])
>>> code = komm.SystematicBlockCode(parity_submatrix=[[0, 1, 1], [1, 1, 0]], information_set='right')
>>> (code.length, code.dimension, code.redundancy)
(5, 2, 3)
>>> code.generator_matrix
array([[0, 1, 1, 1, 0],
[1, 1, 0, 0, 1]])
>>> code.check_matrix
array([[1, 0, 0, 0, 1],
[0, 1, 0, 1, 1],
[0, 0, 1, 1, 0]])