Skip to content

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^\top$. The matrix $P \in \mathbb{B}^{k \times m}$ is called the parity submatrix of the code.

The constructor expects the parity submatrix the information set.

Parameters:

  • parity_submatrix (Array2D[int])

    The parity submatrix $P$ the code, which is a $k \times m$ binary matrix.

  • information_set (Optional[Array1D[int] | str])

    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, 0, 1], [1, 1, 0]])
>>> (code.length, code.dimension, code.redundancy)
(6, 3, 3)
>>> code.generator_matrix
array([[1, 0, 0, 0, 1, 1],
       [0, 1, 0, 1, 0, 1],
       [0, 0, 1, 1, 1, 0]])
>>> code.check_matrix
array([[0, 1, 1, 1, 0, 0],
       [1, 0, 1, 0, 1, 0],
       [1, 1, 0, 0, 0, 1]])