MATLAB Practice on Linear
Code
School of Electrical Engineering
Korea Advanced Institute of Science and Technology
1
Basic Definitions
Definition (Hamming Distance)
The Hamming distance between a sequence and a sequence is the number of
positions that the corresponding elements
differ:
Definition (Minimum Distance)
The minimum distance of a code is the smallest Hamming distance between
any two codewords in the code:
2
Hamming Codes
Richard Wesley Hamming (1915 – 1998) was
an American mathematician whose work had
many implications for computer science and
telecommunications. His contributions include
the Hamming code (which makes use of a
Hamming matrix), the Hamming window,
Hamming numbers, sphere-packing (or
Hamming bound) and the Hamming distance.
3
Hamming Codes
Definition (Hamming Codes)
For any integer , a () binary code may be defined by its parity check matrix ,
which is obtained by writing all possible binary -tuples, except the all-zero
tuple, as the columns of . For example, simply write out the -bit binary
representation for the numbers from 1 to in order. Codes equivalent to this
construction are called Hamming codes.
4
[7, 4] Hamming Code
5
Design of Hamming Codes
Note that the columns of parity-check matrix are unique,
Then,
where .
6
Error rate of [7, 4] Hamming Code
• The probability of decoder error/word error rate,
For Hamming codes, it can also approximated as
where
7
Error rate of [7, 4] Hamming Code
8
9