In coding theory, the Bose - Chaudhuri - Hocquenghem codes (BCH codes) form a class of cyclic error-correcting codes that are constructed using polynomials over a finite field (also called a Galois field). BCH codes were invented in 1959 by French mathematician Alexis Hocquenghem, and independently in 1960 by Raj Chandra Bose and D.K. Ray-Chaudhuri. The name Bose - Chaudhuri - Hocquenghem (and the acronym BCH) arises from the initials of the inventors' surnames (mistakenly, in the case of Ray-Chaudhuri).
One of the key features of BCH codes is that during code design, there is a precise control over the number of symbol errors correctable by the code. In particular, it is possible to design binary BCH codes that can correct multiple bit errors. Another advantage of BCH codes is the ease with which they can be decoded, namely, via an algebraic method known as syndrome decoding. This simplifies the design of the decoder for these codes, using small low-power electronic hardware.
BCH codes are used in applications such as satellite communications,[1] compact disc players, DVDs, disk drives, USB flash drives, solid-state drives,[2] and two-dimensional bar codes.
Given a prime number and prime power with positive integers and such that, a primitive narrow-sense BCH code over the finite field (or Galois field) with code length and distance at least is constructed by the following method.
Let be a primitive element of .For any positive integer, let be the minimal polynomial with coefficients in of .The generator polynomial of the BCH code is defined as the least common multiple .It can be seen that is a polynomial with coefficients in and divides .Therefore, the polynomial code defined by is a cyclic code.
Let and (therefore). We will consider different values of for based on the reducing polynomial, using primitive element . There are fourteen minimum polynomials with coefficients in satisfying
i\right) | |
m | |
i\left(\alpha |
\bmod\left(z4+z+1\right)=0.
The minimal polynomials are
\begin{align} m1(x)&=m2(x)=m4(x)=m8(x)=x4+x+1,\\ m3(x)&=m6(x)=m9(x)=m12(x)=x4+x3+x2+x+1,\\ m5(x)&=m10(x)=x2+x+1,\\ m7(x)&=m11(x)=m13(x)=m14(x)=x4+x3+1. \end{align}
The BCH code with
d=2,3
g(x)={\rmlcm}(m1(x),m2(x))=m1(x)=x4+x+1.
It has minimal Hamming distance at least 3 and corrects up to one error. Since the generator polynomial is of degree 4, this code has 11 data bits and 4 checksum bits. It is also denoted as: (15, 11) BCH code.
The BCH code with
d=4,5
\begin{align} g(x)&={\rmlcm}(m1(x),m2(x),m3(x),m4(x))=m1(x)m3(x)\\ &=\left(x4+x+1\right)\left(x4+x3+x2+x+1\right)=x8+x7+x6+x4+1. \end{align}
It has minimal Hamming distance at least 5 and corrects up to two errors. Since the generator polynomial is of degree 8, this code has 7 data bits and 8 checksum bits. It is also denoted as: (15, 7) BCH code.
The BCH code with
d=6,7
\begin{align} g(x)&={\rmlcm}(m1(x),m2(x),m3(x),m4(x),m5(x),m6(x))=m1(x)m3(x)m5(x)\\ &=\left(x4+x+1\right)\left(x4+x3+x2+x+1\right)\left(x2+x+1\right)=x10+x8+x5+x4+x2+x+1. \end{align}
It has minimal Hamming distance at least 7 and corrects up to three errors. Since the generator polynomial is of degree 10, this code has 5 data bits and 10 checksum bits. It is also denoted as: (15, 5) BCH code. (This particular generator polynomial has a real-world application, in the "format information" of the QR code.)
The BCH code with
d=8
\begin{align} g(x)&={\rmlcm}(m1(x),m2(x),...,m14(x))=m1(x)m3(x)m5(x)m7(x)\\ &=\left(x4+x+1\right)\left(x4+x3+x2+x+1\right)\left(x2+x+1\right)\left(x4+x3+1\right)=x14+x13+x12+ … +x2+x+1. \end{align}
This code has minimal Hamming distance 15 and corrects 7 errors. It has 1 data bit and 14 checksum bits. It is also denoted as: (15, 1) BCH code. In fact, this code has only two codewords: 000000000000000 and 111111111111111 (a trivial repetition code).
General BCH codes differ from primitive narrow-sense BCH codes in two respects.
First, the requirement that
\alpha
GF(qm)
qm-1
ord(\alpha),
\alpha.
Second, the consecutive roots of the generator polynomial may run from
\alphac,\ldots,\alphac+d-2
\alpha,\ldots,\alphad-1.
Definition. Fix a finite field
GF(q),
q
m,n,d,c
2\leqd\leqn,
{\rmgcd}(n,q)=1,
m
q
n.
As before, let
\alpha
n
GF(qm),
mi(x)
GF(q)
\alphai
i.
g(x)={\rmlcm}(mc(x),\ldots,mc+d-2(x)).
Note: if
n=qm-1
{\rmgcd}(n,q)
q
n
m.
c=1
n=qm-1
The generator polynomial
g(x)
GF(q).
GF(qp)
g(x)
GF(qp).
GF(qm)
g(x)
\alpha
GF(qm)
The generator polynomial of a BCH code has degree at most
(d-1)m
q=2
c=1
dm/2
mi(x)
m
d-1
(d-1)m
q=2,
mi(x)=m2i(x)
i
g(x)
d/2
mi(x)
i,
m
A BCH code has minimal Hamming distance at least
d
p(x)
d
p(x)=
k1 | |
b | |
1x |
+ … +bd-1
kd-1 | |
x |
,wherek1<k2< … <kd-1.
Recall that
\alphac,\ldots,\alphac+d-2
g(x),
p(x)
b1,\ldots,bd-1
i\in\{c,...c,c+d-2\}
p(\alphai)=
ik1 | |
b | |
1\alpha |
+
ik2 | |
b | |
2\alpha |
+ … +bd-1
ikd-1 | |
\alpha |
=0.
In matrix form, we have
\begin{bmatrix}
ck1 | |
\alpha |
&
ck2 | |
\alpha |
& … &
ckd-1 | |
\alpha |
\\
(c+1)k1 | |
\alpha |
&
(c+1)k2 | |
\alpha |
& … &
(c+1)kd-1 | |
\alpha |
\\ \vdots&\vdots&&\vdots\\
(c+d-2)k1 | |
\alpha |
&
(c+d-2)k2 | |
\alpha |
& … &
(c+d-2)kd-1 | |
\alpha |
\\ \end{bmatrix}\begin{bmatrix} b1\ b2\ \vdots\ bd-1\end{bmatrix}=\begin{bmatrix} 0\ 0\ \vdots\ 0 \end{bmatrix}.
The determinant of this matrix equals
d-1 | |
\left(\prod | |
i=1 |
cki | |
\alpha |
\right)\det\begin{pmatrix} 1&1& … &1\\
k1 | |
\alpha |
&
k2 | |
\alpha |
& … &
kd-1 | |
\alpha |
\\ \vdots&\vdots&&\vdots\\
(d-2)k1 | |
\alpha |
&
(d-2)k2 | |
\alpha |
& … &
(d-2)kd-1 | |
\alpha |
\\ \end{pmatrix}=
d-1 | |
\left(\prod | |
i=1 |
cki | |
\alpha |
\right)\det(V).
The matrix
V
\det(V)=\prod1\le
kj | |
\left(\alpha |
-
ki | |
\alpha |
\right),
b1,\ldots,bd-1=0,
p(x)=0.
A BCH code is cyclic.A polynomial code of length
n
xn-1.
g(x)
\alphac,\ldots,\alphac+d-2,
\alphac,\ldots,\alphac+d-2
xn-1.
\alpha
n
Because any polynomial that is a multiple of the generator polynomial is a valid BCH codeword, BCH encoding is merely the process of finding some polynomial that has the generator as a factor.
The BCH code itself is not prescriptive about the meaning of the coefficients of the polynomial; conceptually, a BCH decoding algorithm's sole concern is to find the valid codeword with the minimal Hamming distance to the received codeword. Therefore, the BCH code may be implemented either as a systematic code or not, depending on how the implementor chooses to embed the message in the encoded polynomial.
The most straightforward way to find a polynomial that is a multiple of the generator is to compute the product of some arbitrary polynomial and the generator. In this case, the arbitrary polynomial can be chosen using the symbols of the message as coefficients.
s(x)=p(x)g(x)
As an example, consider the generator polynomial
g(x)=x10+x9+x8+x6+x5+x3+1
GF(2)
p(x)=x20+x18+x17+x15+x14+x13+x11+x10+x9+x8+x6+x5+x4+x3+x2+1
GF(2)
\begin{align} s(x)&=p(x)g(x)\\ &=\left(x20+x18+x17+x15+x14+x13+x11+x10+x9+x8+x6+x5+x4+x3+x2+1\right)\left(x10+x9+x8+x6+x5+x3+1\right)\\ &=x30+x29+x26+x25+x24+x22+x19+x17+x16+x15+x14+x12+x10+x9+x8+x6+x5+x4+x2+1 \end{align}
The receiver can use these bits as coefficients in
s(x)
p(x)=s(x)/g(x)
A systematic code is one in which the message appears verbatim somewhere within the codeword. Therefore, systematic BCH encoding involves first embedding the message polynomial within the codeword polynomial, and then adjusting the coefficients of the remaining (non-message) terms to ensure that
s(x)
g(x)
This encoding method leverages the fact that subtracting the remainder from a dividend results in a multiple of the divisor. Hence, if we take our message polynomial
p(x)
xn-k
p(x)xn-k=q(x)g(x)+r(x)
Here, we see that
q(x)g(x)
r(x)
n-k
g(x)
p(x)xn-k
s(x)
s(x)=q(x)g(x)=p(x)xn-k-r(x)
Over
GF(2)
The advantage to the systematic coding is that the receiver can recover the original message by discarding everything after the first
k
There are many algorithms for decoding BCH codes. The most common ones follow this general outline:
During some of these steps, the decoding algorithm may determine that the received vector has too many errors and cannot be corrected. For example, if an appropriate value of t is not found, then the correction would fail. In a truncated (not primitive) code, an error location may be out of range. If the received vector has more errors than the code can correct, the decoder may unknowingly produce an apparently valid message that is not the one that was sent.
The received vector
R
C
E.
R
\alphac,\ldots,\alphac+d-2.
sj=R\left(\alphaj\right)=C\left(\alphaj\right)+E\left(\alphaj\right)
for
j=c
c+d-2.
Since
\alphaj
g(x),
C(x)
C\left(\alphaj\right)=0.
If there is no error,
sj=0
j.
If there are nonzero syndromes, then there are errors. The decoder needs to figure out how many errors and the location of those errors.
If there is a single error, write this as
E(x)=exi,
i
e
\begin{align} sc&=e\alphaci\\ sc+1&=e\alpha(c+1)i=\alphaisc \end{align}
e
i
If there are two or more errors,
E(x)=e1
i1 | |
x |
+e2
i2 | |
x |
+ …
It is not immediately obvious how to begin solving the resulting syndromes for the unknowns
ek
ik.
The first step is finding, compatible with computed syndromes and with minimal possible
t,
Λ(x)=
t | |
\prod | |
j=1 |
ij | |
\left(x\alpha |
-1\right)
Three popular algorithms for this task are:
Peterson's algorithm is the step 2 of the generalized BCH decoding procedure. Peterson's algorithm is used to calculate the error locator polynomial coefficients
λ1,λ2,...,λv
Λ(x)=1+λ1x+λ2x2+ … +λvxv.
Now the procedure of the Peterson–Gorenstein–Zierler algorithm. Expect we have at least 2t syndromes sc, …, sc+2t−1. Let v = t.
Now that you have the
Λ(x)
Λ(x)=
i1 | |
\left(\alpha |
x-
i2 | |
1\right)\left(\alpha |
x-1\right) …
iv | |
\left(\alpha |
x-1\right)
\alpha
The zeros of Λ(x) are α−i1, …, α−iv.
Once the error locations are known, the next step is to determine the error values at those locations. The error values are then used to correct the received values at those locations to recover the original codeword.
For the case of binary BCH, (with all characters readable) this is trivial; just flip the bits for the received word at these positions, and we have the corrected code word. In the more general case, the error weights
ej
\begin{align} sc&=e1
ci1 | |
\alpha |
+e2
ci2 | |
\alpha |
+ … \\ sc+1&=e1
(c+1)i1 | |
\alpha |
+e2
(c+1)i2 | |
\alpha |
+ … \\ &{} \vdots \end{align}
However, there is a more efficient method known as the Forney algorithm.
Let
S(x)=sc+sc+1x+sc+2x2+ … +sc+d-2xd-2.
v\leqslantd-1,λ0 ≠ 0 Λ(x)=
vλ | |
\sum | |
i |
xi=λ0
v | |
\prod | |
k=0 |
-ik | |
\left(\alpha |
x-1\right).
And the error evaluator polynomial
\Omega(x)\equivS(x)Λ(x)\bmod{xd-1
Finally:
Λ'(x)=
v | |
\sum | |
i=1 |
i ⋅ λixi-1,
where
i ⋅ x:=
i | |
\sum | |
k=1 |
x.
Than if syndromes could be explained by an error word, which could be nonzero only on positions
ik
ek=
ik | |
-{\alpha |
-ik | |
\Omega\left(\alpha |
\right)\over
c ⋅ ik | |
\alpha |
-ik | |
Λ'\left(\alpha |
\right)}.
For narrow-sense BCH codes, c = 1, so the expression simplifies to:
ek=
-ik | |
-{\Omega\left(\alpha |
\right)\over
-ik | |
Λ'\left(\alpha |
\right)}.
It is based on Lagrange interpolation and techniques of generating functions.
Consider
S(x)Λ(x),
λk=0
k>v,
sk=0
k>c+d-2.
S(x)Λ(x)=
infty | |
\sum | |
j=0 |
j | |
\sum | |
i=0 |
sj-i+1λixj.
\begin{align} S(x)Λ(x) &=S(x)\left\{λ0\prod
v | |
\ell=1 |
\left
i\ell | |
(\alpha |
x-1\right)\right\}\\ &=\left\{
d-2 | |
\sum | |
i=0 |
v | |
\sum | |
j=1 |
(c+i) ⋅ ij | |
e | |
j\alpha |
xi\right\}\left\{λ0\prod
v | |
\ell=1 |
\left
i\ell | |
(\alpha |
x-1\right)\right\}\\ &=\left\{
v | |
\sum | |
j=1 |
ej
cij | |
\alpha |
d-2 | |
\sum | |
i=0 |
\left
ij | |
(\alpha |
\right)ixi\right\}\left\{λ0\prod
v | |
\ell=1 |
\left
i\ell | |
(\alpha |
x-1\right)\right\}\\ &=\left\{
v | |
\sum | |
j=1 |
ej
cij | |
\alpha |
| |||||||
|
\right\}\left\{λ0
v | |
\prod | |
\ell=1 |
\left
i\ell | |
(\alpha |
x-1\right)\right\}\\ &=λ0
v | |
\sum | |
j=1 |
cij | |
e | |
j\alpha |
| |||||||
|
v | |
\prod | |
\ell=1 |
\left
i\ell | |
(\alpha |
x-1\right)\\ &=λ0
v | |
\sum | |
j=1 |
cij | |
e | |
j\alpha |
\left(\left
ij | |
(x\alpha |
\right)d-1-1\right)\prod\ell\in\{1, … ,v\\setminus\{j\}}\left
i\ell | |
(\alpha |
x-1\right) \end{align}
We want to compute unknowns
ej,
ij | |
\left(x\alpha |
\right)d-1
\Omega(x)\equivS(x)Λ(x)\bmod{xd-1
Thanks to
v\leqslantd-1
\Omega(x)=-λ0\sum
v | |
j=1 |
cij | |
e | |
j\alpha |
\prod\ell\in\{1, … ,v\\setminus\{j\}}
i\ell | |
\left(\alpha |
x-1\right).
Thanks to
Λ
x=
-ik | |
\alpha |
\Omega
-ik | |
\left(\alpha |
\right)=-λ0
c ⋅ ik | |
e | |
k\alpha |
\prod\ell\in\{1, … ,v\\setminus\{k\}}
i\ell | |
\left(\alpha |
-ik | |
\alpha |
-1\right).
To get
ek
-ij | |
\alpha |
Λ,
Λ'(x)=λ0\sum
v | |
j=1 |
ij | |
\alpha |
\prod\ell\in\{1, … ,v\\setminus\{j\}}
i\ell | |
\left(\alpha |
x-1\right),
we get again only one summand in
-ik | |
Λ'\left(\alpha |
\right)=
ik | |
λ | |
0\alpha |
\prod\ell\in\{1, … ,v\\setminus\{k\}}
i\ell | |
\left(\alpha |
-ik | |
\alpha |
-1\right).
So finally
ek=-
| |||||||||||
|
.
This formula is advantageous when one computes the formal derivative of
Λ
Λ(x)=
v | |
\sum | |
i=1 |
λixi
yielding:
Λ'(x)=
v | |
\sum | |
i=1 |
i ⋅ λixi-1,
where
i ⋅ x:=
i | |
\sum | |
k=1 |
x.
An alternate process of finding both the polynomial Λ and the error locator polynomial is based on Yasuo Sugiyama's adaptation of the Extended Euclidean algorithm.[3] Correction of unreadable characters could be incorporated to the algorithm easily as well.
Let
k1,...,kk
\Gamma(x)=
k\left(x\alpha | |
\prod | |
i=1 |
ki | |
-1\right).
As we have already defined for the Forney formula let
d-2 | |
S(x)=\sum | |
i=0 |
sc+ixi.
Let us run extended Euclidean algorithm for locating least common divisor of polynomials
S(x)\Gamma(x)
xd-1.
r(x)
\lfloor(d+k-3)/2\rfloor
a(x),b(x)
r(x)=a(x)S(x)\Gamma(x)+b(x)xd-1.
r(x)
a(x)
\Gamma
Λ.
Defining
\Xi(x)=a(x)\Gamma(x)
\Xi
Λ(x)
The main advantage of the algorithm is that it meanwhile computes
\Omega(x)=S(x)\Xi(x)\bmodxd-1=r(x)
The goal is to find a codeword which differs from the received word minimally as possible on readable positions. When expressing the received word as a sum of nearest codeword and error word, we are trying to find error word with minimal number of non-zeros on readable positions. Syndrom
si
si=\sum
n-1 | |
j=0 |
ij | |
e | |
j\alpha |
.
We could write these conditions separately or we could create polynomial
d-2 | |
S(x)=\sum | |
i=0 |
sc+ixi
and compare coefficients near powers
0
d-2.
S(x)\stackrel{\{0, … ,d-2\}}{=}
d-2 | |
E(x)=\sum | |
i=0 |
n-1 | |
\sum | |
j=0 |
ij | |
e | |
j\alpha |
\alphacjxi.
Suppose there is unreadable letter on position
k1,
\{sc, … ,sc+d-2\}
\{tc, … ,tc+d-3\}
k1 | |
t | |
i=\alpha |
si-si+1.
\{sc, … ,sc+d-2\}
k1 | |
t | |
i=\alpha |
si-si+1
k1 | |
=\alpha |
n-1 | |
\sum | |
j=0 |
ij | |
e | |
j\alpha |
n-1 | |
-\sum | |
j=0 |
j\alpha | |
e | |
j\alpha |
ij
n-1 | |
=\sum | |
j=0 |
k1 | |
e | |
j\left(\alpha |
-\alphaj\right)\alphaij.
New set of syndromes restricts error vector
fj=e
k1 | |
j\left(\alpha |
-\alphaj\right)
the same way the original set of syndromes restricted the error vector
ej.
k1,
f | |
k1 |
=0,
fj
ej=0.
k.
In polynomial formulation, the replacement of syndromes set
\{sc, … ,sc+d-2\}
\{tc, … ,tc+d-3\}
T(x)=
d-3 | |
\sum | |
i=0 |
tc+ixi=\alpha
k1 | |
d-3 | |
\sum | |
i=0 |
sc+i
d-2 | |
x | |
i=1 |
sc+ixi-1.
Therefore,
xT(x)\stackrel{\{1, … ,d-2\}}{=}
k1 | |
\left(x\alpha |
-1\right)S(x).
After replacement of
S(x)
S(x)\Gamma(x)
k, … ,d-2.
One could consider looking for error positions from the point of view of eliminating influence of given positions similarly as for unreadable characters. If we found
v
Λ(x)
S(x)\Gamma(x)Λ(x)\stackrel{\{k+v, … ,d-2\}}{=}0.
In Euclidean algorithm, we try to correct at most
\tfrac{1}{2}(d-1-k)
Λ(x)
k+\left\lfloor
1 | |
2 |
(d-1-k)\right\rfloor.
In Forney formula,
Λ(x)
It could happen that the Euclidean algorithm finds
Λ(x)
\tfrac{1}{2}(d-1-k)
Λ(x)
Λ(x)
Using the error values and error location, correct the errors and form a corrected code vector by subtracting error values at error locations.
Consider a BCH code in GF(24) with
d=7
g(x)=x10+x8+x5+x4+x2+x+1
M(x)=x4+x3+x+1.
x10M(x)
g(x)
x9+x4+x2
Now, imagine that there are two bit-errors in the transmission, so the received codeword is [1 {{color|red|0}} 0 1 1 1 0 0 0 {{color|red|1}} 1 0 1 0 0 ]. In polynomial notation:
R(x)=C(x)+x13+x5=x14+x11+x10+x9+x5+x4+x2
\alpha=0010,
s1=R(\alpha1)=1011,
s2=1001,
s3=1011,
s4=1101,
s5=0001,
s6=1001.
\left[S3|C3\right]= \begin{bmatrix}s1&s2&s3&s4\\ s2&s3&s4&s5\\ s3&s4&s5&s6\end{bmatrix}= \begin{bmatrix}1011&1001&1011&1101\\ 1001&1011&1101&0001\\ 1011&1101&0001&1001\end{bmatrix} ⇒ \begin{bmatrix}0001&0000&1000&0111\\ 0000&0001&1011&0001\\ 0000&0000&0000&0000 \end{bmatrix}