optic.comm.fec.hammingParityCheckMatrix

hammingParityCheckMatrix(m, extended=False)

Generate the parity-check matrix H for a Hamming code with m check bits .

Parameters:
  • m (int) – Number of check bits.

  • extended (bool, optional) – If True, generate the parity-check matrix for the extended Hamming code (default is False).

Returns:

H – Parity-check matrix for the Hamming code, where m = n - k and k is the number of message bits.

Return type:

np.array of shape (m, n)

Notes

  • For standard Hamming codes, the code parameters are \(n = 2^m - 1\) and \(k = n - m\).

  • For extended Hamming codes, the code parameters are \(n = 2^m\) and \(k = n - m - 1\).

References

[1] R. W. Hamming, “Error detecting and error correcting codes,” Bell System Technical Journal, vol. 29, no. 2, pp. 147-160, April 1950.

[2] S. Lin and D. J. Costello, “Error Control Coding: Fundamentals and Applications,” 2nd Edition, Pearson, 2004.