optic.comm.fec.encodeHamming
- encodeHamming(bits, param)
Encode binary sequences using a Hamming code.
- Parameters:
bits (np.array of shape (k, N)) – Binary input sequences to encode. Each column is a bit sequence of length \(k\).
param (object) –
Object containing the following attributes:
- mint
Number of check bits for the Hamming code.
- extendedbool, optional
If True, use the extended Hamming code (default is False).
- Returns:
codewords – Encoded binary codewords. Each column corresponds to a codeword of length \(n\) resulting from applying the Hamming encoding to the respective input bit sequence.
- Return type:
np.array of shape (n, N)
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.