Professional Documents
Culture Documents
Cyclic and BCH Codes
Cyclic and BCH Codes
Cyclic and BCH Codes
Maheshanand
IIT Roorkee
IIT Patna
1 Introduction
4 BCH Codes
5 Reed-Solomon Codes
This gives a one-one correspondence between Fnq and the set of all
polynomials of degree at most n − 1 over Fq .
Theorem
Let C be a linear code of length n over a field Fq . Then C is a cyclic code if
and only if C is an ideal of Rn = Fq [x]/(x n − 1).
Proof.
If C is an ideal of Rn = Fq [x]/(x n − 1), then for any c(x) ∈ C, the element
xc(x) is also in C. Thus C is closed under the operation of cyclic shift, and
hence C is a cyclic code.
Conversely suppose C is a cyclic code. Then for any c(x) ∈ C, the elements
is again in C. This implies that for any a(x) ∈ Rn , the element a(x)c(x) ∈ Rn .
So, C is an ideal of Rn .
(i) C = ⟨g(x)⟩.
Let c(x) ∈ C. Then c(x) = a(x)g(x) for some a(x) ∈ Fq [x]. Since
deg a(x)g(x) = deg c(x) < n, and deg g(x) = n − k , we must have
deg a(x) < k .
Thus, c(x) is a linear combination of the elements g(x), xg(x), . . . , x k −1 g(x).
Hence the set {g(x), xg(x), . . . , x k −1 g(x)} spans C over Fq .
Now suppose that there exist a0 , a1 , . . . , ak −1 ∈ Fq such that
Example
Consider cyclic codes of length 7 over F2 . x 7 − 1 factorizes into monic
irreducible polynomials over F2 as
x n−k m(x) = q(x)g(x) + r (x), r (x) = 0 or deg r (x) < deg g(x) = n − k .
Then x n−k m(x) − r (x) = q(x)g(x) ∈ C, i.e, x n−k m(x) − r (x) is a codeword
in C. Now let m(x) ↔ (m0 , m1 , . . . , mk −1 ) and r (x) ↔ (r0 , r1 , . . . , rn−k −1 ) (as
deg r (x) < n − k ). Then
Now let c(x) ∈ C be any codeword. Then c(x) = a(x)g(x) for some
a(x) ∈ Fq [x]. Then
Let C be an [n, k ]-cyclic code over Fq with the check polynomial h(x). Then
deg h(x) = k = n − deg g(x).
Let h(x) = h0 + h1 x + · · · + hk x k and let c(x) = c0 + c1 x + · · · + cn−1 x n−1 be
a codeword in C.
Then c(x)h(x) = 0 in Rn . The coefficient of x j in the product c(x)h(x) (in Rn )
is
Xn−1
ci hj−i , j = 0, 1, . . . , n − 1 ,
i=0
f ∗ (x) = x n f (x −1 ) = fn + fn−1 x + · · · + f0 x n .
The coefficients f ∗ (x) are the coefficients of f (x) taken in the reverse order.
The parity-check matrix H of C given in (1) above correspond to h∗ (x) and its
cyclic shifts xh∗ (x), x 2 h∗ (x), . . . , x n−k −1 h∗ (x).
Therefore it follows that the linear code whose generator matrix is H, i.e., the
dual code C ⊥ of C, is a cyclic code with h∗ (x) as a generator, i.e,
C ⊥ = ⟨h∗ (x)⟩.
Now the polynomial h⊥ (x) = h0−1 h∗ (x) is a monic polynomial such that
C ⊥ = ⟨h⊥ (x)⟩ and h⊥ (x) | (x n − 1). It follows from this discussion that
where r is the smallest positive integer such that sq r ≡ s (mod n). Since all
the roots of mαs (x) are nth roots of unity, mαs (x) | (x n − 1), and thus mαs (x)
is a monic irreducible factor of x n − 1 over Fq . Also, from the theory of finite
fields, we know that deg mαs (x) | m.
Cs = {s, sq, sq 2 , . . . , sq r −1 } ,
where r is the smallest positive integer such that sq r ≡ s (mod n). The
cylotomic coset Cs is generally represented by the smallest non-negative
integer in Cs .
q-cyclotomic cosets modulo n partition the set {0, 1, 2, . . . , n − 1}.
Maheshanand Cyclic and BCH Codes
Factorization of x n − 1 over Fq
From our discussion above, the minimal polynomial mαs (x) of αs over Fq is
given by Y
mαs (x) = (x − αi ) . (2)
i∈Cs
Now if mαs1 (x), mαs2 (x), . . . , mαsk (x) are distinct minimal polynomials of the
nth roots of unity over Fq , then x n − 1 = mαs1 (x)mαs2 (x) · · · mαsk (x) is the
factorization of x n − 1 into monic irreducible factors over Fq .
Then from equation (2), we have
Y Y
xn − 1 = (x − αi ) , (3)
s i∈Cs
Example
1 Consider the factorization of x 9 − 1 over F2 .
The smallest extension of F2 which contains a primitive 9th root of unity is
F26 , because m = 6 is the smallest positive integer such that 9 divides
2m − 1.
The 2-cyclotomic cosets modulo 9 are
C0 = {0}, C1 = {1, 3, 9}, C2 = {2, 6, 5}, C4 = {4, 12, 10}, C7 = {7, 8, 11} .
The set
Z = {αi | g(αi ) = 0, 0 ≤ i ≤ n − 1}
is called the set of zeros of the code C.
The set
T = {i | 0 ≤ i ≤ n − 1, g(αi ) = 0}
is called the defining set of C.
As g(x) can be expressed as a product of some monic irreducible factors of
x n − 1 over Fq , from equation (3), g(x) can be expressed as
Y YY
g(x) = mαs (x) = (x − αi ) ,
s s i∈Cs
Proof.
Since αb , αb+1 , . . . , αb+δ−2 are roots of C, for any c(x) ∈ C, we have
αb α2b
1 ··· α(n−1)b
1
αb+1 α2(b+1) ··· α(n−1)(b+1)
H= . . . . .. .
. .
. .
. .
b+δ−2 2(b+δ−2) (n−1)(b+δ−2)
1 α α ··· α
Maheshanand Cyclic and BCH Codes
BCH bound
Proof continued.
Now consider any δ − 1 columns of H, say columns headed by the elements
αi1 b , αi2 b , . . . , αiδ−1 b . The corresponding submatrix of H is a (δ − 1) × (δ − 1)
matrix
αi1 b αi2 b αiδ−1 b
···
αi1 (b+1) αi2 (b+1) ··· αiδ−1 (b+1)
H′ =
.. .. .. .. .
. . . .
αi1 (b+δ−2) αi2 (b+δ−2) · · · αiδ−1 (b+δ−2)
Now |H ′ | = αi1 b αi2 b · · · αiδ−1 b |M|, where M is the Vandermonde matrix
1 1 ··· 1
αi1 αi2 ··· αiδ−1
M= .. .. .. .. .
. . . .
i1 (δ−2) i2 (δ−2) iδ−1 (δ−2)
α α ··· α
Y r
We know that |M| = (α − αs ), where r , s ∈ {i1 , i2 , . . . , iδ−1 }.
r >s
Proof continued.
As α is a primitive nth root of unity, αi1 , αi2 , . . . , αiδ−1 are all distinct.
Therefore, |M| ̸= 0.
Hence |H ′ | =
̸ 0, i.e., H ′ is non-singular.
So the columns of H ′ are linearly independent over Fq m and hence over Fq .
Thus, every set of δ − 1 columns of H are linearly independent over Fq .
Therefore, d(C) ≥ δ.
Theorem
A binary Hamming code is equivalent to a cyclic code.
Proof.
Let n = 2r − 1, where r is a positive integer. Let α be a primitive element of
F2r . Then α is a primitive (2r − 1)th root of unity, i.e, a primitive nth root of
unity. Let C be a binary cyclic code of length n and defining set T = {1}.
Then c(α1 ) = c(α) = 0 for all c(x) ∈ C. Therefore the matrix
H = [1, α, α2 , . . . , αn−1 ]
Proof.
Let α be a primitive nth root of unity in Fq r . Since the defining set of C is {1},
we have c(α) = 0 for all c(x) ∈ C.
Therefore, the matrix
H = [1, α, α2 , . . . , αn−1 ]
is a parity-check matrix of C over Fq r .
Now given that (r , q − 1) = 1. Also, we have
r
−1
n = qq−1 = 1 + q + · · · + q r −1 = 1 + 1 + · · · + 1 = r (mod q − 1).
Then n = m(q − 1) + r for some m ∈ Z, and so (n, q − 1) = (q − 1, r ) = 1.
Now since (n, q − 1) = 1, αq−1 is also a primitive nth root of unity.
So α(q−1)i , 0 ≤ i ≤ n − 1, are all distinct.
Maheshanand Cyclic and BCH Codes
Hamming codes as cyclic codes:
Proof.
We claim that any two columns of H are linearly independent over Fq .
Suppose ∃ a1 , a2 ̸= 0 in Fq such that
The binary BCH codes were discovered by Bose and Ray-Chaudhuri (1960)
and independently by Hocquenghem (1959), and were generalized to
arbitrary finite fields by Gorenstein and Zierler (1961).
BCH codes are cyclic codes designed to take the advantage of the BCH
bound.
The objective is to construct a cyclic code C of length n which simultaneously
has high minimum distance and high dimension.
The high minimum distance can be accomplished by choosing the defining
set T of C to have a large number of consecutive elements.
Since dim C = n − |T |, high dimension can be obtained by taking |T | as small
as possible.
Therefore, to meet our objectives, T should be taken to have δ − 1
consecutive elements such that |T | is as small as possible.
T = Cb ∪ Cb+1 ∪ · · · ∪ Cb+δ−2 ,
Proof.
Let T = Cb ∪ Cb+1 ∪ · · · ∪ Cb+δ−2 be the defining set of C. Then
Now |Cb ∪ Cb+1 ∪ · · · ∪ Cb+δ−2 | ≤ m(δ − 1), because the size of any
q-cyclotomic coset Ci modulo n is at most m. Hence
dim C ≥ n − m(δ − 1).
For binary BCH codes, we have a better bound on the dimension of the
codes than as given by the above result.
Theorem
For any positive integer m and t ≤ 2m−1 − 1, there is a binary BCH code of
length n = 2m − 1 that is t-error-correcting and has dimension ≥ n − mt.
Now since wt(g(x)) = 5 and d(C) ≥ 5, the code C has minimum distance
exactly 5.
Thus, C is a [15, 7, 5] binary code.
T = C1 ∪ C2 ∪ C3 ,
Now (1 + x)g(x) = 1 + x 4 + x 5 + x 7 .
x n − 1 = (x − 1)(x − α) · · · (x − αn−1 ) .
Proof.
Let C be an RS code over Fq with designed distance δ. Then we have d ≥ δ,
where d is the minimum distance of C. Also, from above, the dimension of C
is
k = n − (δ − 1) = n − δ + 1 .
Since d ≥ δ, we have k ≥ n − d + 1, and hence d ≥ n − k + 1. But by the
Singleton bound, d ≤ n − k + 1. Therefore, d = n − k + 1. Hence C is an
MDS code.
Maheshanand Cyclic and BCH Codes
Reed-Solomon codes
Example
Let C be a narrow-sense RS code of length 12 and designed distance 5 over
F13 . A primitive element of F13 is 2. C has minimum distance 5, and by
Theorem 16, dim C = k = 12 − 5 + 1 = 8. So C is an [12, 8, 5] MDS code
over F13 . A generator polynomial for C is
n o
C= f (1), f (α), . . . , f (αn−1 ) | f ∈ Pk . (4)
Theorem
Proof.
It is well known that Pk is a vector space of dimension k over Fq .
It is easy to show that C is a vector space over Fq .
Now consider the map ϕ : Pk → C defined by
f 7→ f (1), f (α), . . . , f (αn−1 ) ,
where f ∈ Pk .
We claim that ϕ is a bijection. For any f , g ∈ Pk we have
Proof continued.
Now let c = f (1), f (α), . . . , f (αn−1 ) be a non-zero codeword in C for some
k −1 k −1
n−1
! n−1
X X X X
= fm αmj αij = fm α(m+i)j
j=0 m=0 m=0 j=0
k −1 (m+i)n
X α −1
= fm =0.
αm+i − 1
m=0