optic.comm.fec.par2gen

par2gen(H)

Convert a binary parity-check matrix H into a systematic generator matrix G over GF(2).

Parameters:

H (np.array of shape (n - k, n)) – Parity-check matrix with entries in {0, 1}.

Returns:

  • G (np.array of shape (k, n)) – Systematic generator matrix corresponding to the input parity-check matrix H. The form of G is \([I_k | P]\), where \(I_k\) is the identity matrix and \(P\) is a binary matrix.

  • colSwaps (np.array of shape (n,)) – Indices representing the column permutations applied to H to obtain Hm. These permutations are required to match the systematic form used in G.

  • Hm (np.array of shape (n - k, n)) – The modified parity-check matrix after Gaussian elimination and column reordering. This matrix has the identity portion on the right-hand side, corresponding to a standard systematic form \([P^T | I_{n-k}]\).

Notes

This method assumes that the parity-check matrix H is full rank and that the identity portion can be isolated on the right via column permutations.