Some Specific Linear Block Codes¶
We review some well-known linear block codes and their important parameters.
Repetition Codes¶
A binary repetition code is an linear block code featuring exactly two codewords of length : the all-zero codeword (e.g., ) and the all-one codeword (e.g., ).
This simple structure encodes a single information bit, repeating it times, yielding a code rate of , which decreases as increases due to heightened redundancy.
The minimum distance , as the two codewords differ in all positions, enhancing error detection and correction capability.
The dual code, an code, comprises all -bit binary sequences with even parity (i.e., an even number of 1s), such as or .
Its minimum distance is , reflecting the smallest number of bit flips (two) needed to change parity, offering minimal but distinct separation.
Hamming Codes¶
Hamming codes, among the earliest constructs in coding theory, are linear block codes defined by parameters and , where is an integer determining the code’s size (e.g., for , , ).
These codes are efficiently characterized by their parity check matrix , an matrix.
The columns of encompass all possible nonzero binary vectors of length (e.g., for , columns are 001, 010, 011, 100, 101, 110, 111), excluding the all-zero vector.
This design ensures a systematic approach to error detection, leveraging the full range of nonzero patterns to define parity constraints.
Hamming Codes Properties¶
The code rate of a Hamming code is:
For large , approaches 1 (e.g., : ), indicating high efficiency with minimal redundancy.
The parity check matrix ’s columns, being all nonzero -bit vectors, imply that any two columns sum to a third (e.g., 001 + 010 = 011), making three columns linearly dependent.
Thus, the minimum distance is consistently across all , as no fewer than three columns can be dependent, enabling correction of single-bit errors.
The weight distribution polynomial is:
This formula quantifies the number of codewords per weight, reflecting the code’s structured weight profile and error-correcting capacity.
EXAMPLE: (7, 4) Hamming Code Parity Check Matrix¶
For a Hamming code with , the parity check matrix is constructed using all nonzero binary sequences of length 3 as columns.
Arranging these systematically, we obtain:
This matches the parity check matrix from a prior example, confirming its systematic form where the last columns form an identity matrix.
Tools like MATLAB’s ‘hammgen’ function can generate both and the corresponding generator matrix, validating this structure for a Hamming code with and .
Maximum-Length Codes¶
Maximum-length codes, duals to Hamming codes, are codes for (e.g., (7, 3) for ).
Their generator matrix is the parity check matrix of a Hamming code, with columns comprising all nonzero -bit sequences.
These codes are constant-weight, with all nonzero codewords having weight (e.g., 4 for ), and one codeword of weight 0.
The weight enumeration function is:
Applying the MacWilliams identity to this derives the Hamming code’s weight distribution, linking the dual relationship and confirming the uniform weight property of maximum-length codes.
Reed-Muller Codes¶
Reed-Muller (RM) codes, developed by Reed and Muller in 1954, are linear block codes with block length and order .
Their parameters are:
The generator matrix is:
These codes are notable for simple decoding algorithms, with reflecting the number of basis vectors up to degree , and decreasing as increases, balancing complexity and error correction.
Reed-Muller Codes Generator Matrix¶
The generator matrix components are: , a row of all 1s:
, an matrix with columns as all distinct -bit sequences in binary order (e.g., for , columns range from 000 to 111); and (for to ), a matrix with rows from bitwise multiplication of rows of .
This hierarchical structure generates codewords systematically, leveraging combinatorial patterns for flexibility.
EXAMPLE: Reed-Muller Codes with ¶
A first-order RM code () is an (8, 4) code with:
Derived from a (7, 3) maximum-length code with an added parity bit for even weight, it has .
A second-order RM code () with the same has a larger (8 rows) and , showing how higher order reduces distance while increasing codeword count.
Hadamard Codes¶
Hadamard codes use rows of a Hadamard matrix (where is even) as codewords.
An Hadamard matrix has entries of 0s and 1s, with each row differing from others in exactly positions, one row being all zeros, and others having ones.
For :
Larger matrices are built recursively:
where is the complement of , enabling systematic code expansion.
Hadamard Codes Construction¶
For :
Rows of and form an (4, 3) code with codewords and . Generally, for , parameters are , , though non-power-of-2 lengths yield nonlinear codes.