24.5 Hamming Codes

The Hamming codes are an important class of single error correcting codes that can easily encode and decode. They were originally used in controlling errors in long-distance telephone calls. Binary Hamming codes have the following parameters:

  1. Code length: n=2m1

  2. Dimension: k=2mm1

  3. Minimum distance: d=3

The easiest way to describe a Hamming code is through its parity check matrix. For a binary Hamming code of length n=2m1, first construct an m×n matrix whose columns are all nonzero binary m-tuples. For example, for a [7, 4] binary Hamming code we take m=3, so n=7 and k=4, and start with

101010101100110001111.

In order to obtain a parity check matrix for a code in systematic form, we move the appropriate columns to the end so that the matrix ends with the m×m identity matrix. The order of the other columns is irrelevant. The result is the parity check matrix H for a Hamming [n, k] code. In our example, we move the 4th, 2nd, and 1st columns to the end to obtain

H=110110010110100111001, 

which is the matrix H from Exercise 3.

We can easily calculate a generator matrix G from the parity check matrix H. Since Hamming codes are single error correcting codes, the syndrome method for decoding can be simplified. In particular, the error vector e is allowed to have weight at most 1, and therefore will be zero or will have all zeros except for a single 1 in the jth position.

The Hamming decoding algorithm, which corrects up to one bit error, is as follows:

  1. Compute the syndrome s=yHT for the received vector y. If s=0, then there are no errors. Return the received vector and exit.

  2. Otherwise, determine the position j of the column of H that is the transpose of the syndrome.

  3. Change the jth bit in the received word, and output the resulting code.

As long as there is at most one bit error in the received vector, the result will be the codeword that was sent.

Example

The [15, 11] binary Hamming code has parity check matrix

000011111111000111000011110100011101100110010101110101010001.

Assume the received vector is

y=(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1).

The syndrome s=yHT is calculated to be s=(1, 1, 1, 1). Notice that s is the transpose of the 11th column of H, so we change the 11th bit of y to get the decoded word as

(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1).

Since the first 11 bits give the information, the original message was

(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0).

Therefore, we have detected and corrected the error.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.68