3.2 Hadamard Codes

✐
✐
“437text” — 2015/10/20 — 15:49 — page 58 — #68
✐
58
✐
CHAPTER 3. ERROR-CORRECTING CODES
vectors may still be closest to a unique codeword). So we see that this code
is far from perfect. In Section 3.6, we will present a type of code called a
Hamming code that is perfect.
In practice, it is usually desirable to construct codes that have a large
number of codewords and which are guaranteed to uniquely correct a large
number of bit errors. However, the number of bit errors that are guaranteed
to be uniquely correctable in a code is obviously related to the number
of codewords in the code. Indeed, the problem of constructing a t-error
correcting code C in Zn2 with |C| maximized for fixed values of n and t has
been an important problem of recent mathematical interest. An equivalent
problem is to find the maximum number of vectors in Zn2 such that the balls
of a fixed radius around the vectors can be arranged in the space without
intersecting. This type of problem is called a sphere packing problem.
For the remainder of this chapter and the two subsequent chapters, we
will present several methods for constructing various types of codes and
correcting errors in these codes. To facilitate this, we will establish a set of
parameters that we will use to describe codes. We will describe a code using
the parameters (n, d) if the codewords in the code have length n positions
and the code has minimum distance d.
3.2
Hadamard Codes
For our first method for constructing codes, we will refer back to block designs, the subject of Chapter 2. The following theorem states that the rows
in an incidence matrix for a symmetric block design form the codewords in
an error-correcting code.
Theorem 3.2 Suppose A is an incidence matrix for a (v, v, r, r, λ) block
design. Then the rows of A form a (v, 2(r − λ)) code with v codewords.
Proof. There are v positions in each of the v rows of A. Thus, the rows of
A form a code with v codewords, each of length v positions. It remains to
be shown only that the minimum distance of this code is 2(r − λ). Consider
any pair of rows R1 and R2 in A. Since every row of A contains ones
in r positions, and each pair of rows of A contains ones in common in λ
positions, there will be r − λ positions in which R1 contains a one and R2
contains a zero, and r − λ positions in which R1 contains a zero and R2
contains a one. This yields 2(r − λ) positions in which R1 and R2 differ. !
Example 3.3 Theorem 3.2 states that the rows of the incidence matrix A
in Example 2.3 form a (7, 4) code with 7 codewords.
!
In Theorem 2.5, we showed that a normalized Hadamard matrix
of order 4k ≥ 8 can be used to construct an incidence matrix for a
✐
✐
✐
✐
✐
✐
“437text” — 2015/10/20 — 15:49 — page 59 — #69
✐
✐
59
3.2. HADAMARD CODES
(4k − 1, 4k − 1, 2k − 1, 2k − 1, k − 1) symmetric block design. Theorem 3.2
states that the rows of such an incidence matrix A form codewords of length
4k − 1 positions in a code with minimum distance 2((2k − 1) − (k − 1)) = 2k
and which contains 4k − 1 codewords. Also, recall that each of the rows
of A will contain 2k zeros and 2k − 1 ones. Thus, there will be 2k positions in which the vector (1 1 · · · 1) of length 4k − 1 positions differs from
each of the rows of A. So by including the vector (1 1 · · · 1) of length
4k − 1 positions with the rows of A, we obtain a (4k − 1, 2k) code with 4k
codewords. In addition, as a result of Corollary 3.4 to the following theorem, no additional vectors can be included in this code without decreasing
the minimum distance of the code. Because these (4k − 1, 2k) codes with
4k codewords are constructed from Hadamard matrices, we will call them
Hadamard codes.
We will close this section with the following theorem and corollary,
which verify the fact that no vectors can be joined to the codewords in a
Hadamard code without decreasing the minimum distance of the code.
Theorem 3.3 Suppose r is the number of codewords in an (n, d) code for
2d
.
some n, d with d > n2 . Then r ≤ 2d−n
Proof. Let A = (aij ) be an r × n matrix with the codewords as rows, and
!
let S =
d(u, v) for all distinct pairs u, v of codewords. Now, d(u, v) ≥ d
u,v
"#
(i)
for all pairs u, v of codewords. Thus, S ≥ r2 d = r(r−1)
d. Let t0 and
2
(i)
t1 be the number of times that 0 and 1 appear in the ith column of A,
(i)
(i)
respectively. Then t1 + t0 = r for all i. Also, for the set Ω consisting of
all distinct pairs of rows of A, we have the following.
$$
$$
|aij − akj | =
S =
|aij − akj |
Ω
For each j,
!
Ω
j
j
Ω
|aij − akj | is equal to the number of times that any pair of
distinct rows of A contain differing
entries
in the jth position. This number
&
! (j) %
(j) (j)
(j)
(j) (j)
is t0 t1 , and so S = t0 r − t0 . To find an upper bound on t0 t1 ,
j
consider the function f (x) = x(r − x) for 0 ≤ x ≤ r. Note that f (x) is max%
&
2
2
2
(j) (j)
imized at the point (x, f (x)) = r2 , r4 . Thus, t0 t1 ≤ r4 , and S ≤ nr4 .
"
#
2
2d
So r(r−1)d
≤ nr4 , and r d − n2 ≤ d. Therefore, r ≤ d−d n = 2d−n
.
!
2
2
Corollary 3.4 Suppose r is the number of codewords in a (4k − 1, 2k) code
for some k. Then r ≤ 4k.
Proof. Exercise.
!
✐
✐
✐
✐