BCH code explained

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.

Definition and illustration

Primitive narrow-sense BCH 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.

Example

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

has the generator polynomial

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

has the generator polynomial

\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

has the generator polynomial

\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

and higher has the generator polynomial

\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

General BCH codes differ from primitive narrow-sense BCH codes in two respects.

First, the requirement that

\alpha

be a primitive element of

GF(qm)

can be relaxed. By relaxing this requirement, the code length changes from

qm-1

to

ord(\alpha),

the order of the element

\alpha.

Second, the consecutive roots of the generator polynomial may run from

\alphac,\ldots,\alphac+d-2

instead of

\alpha,\ldots,\alphad-1.

Definition. Fix a finite field

GF(q),

where

q

is a prime power. Choose positive integers

m,n,d,c

such that

2\leqd\leqn,

{\rmgcd}(n,q)=1,

and

m

is the multiplicative order of

q

modulo

n.

As before, let

\alpha

be a primitive

n

th root of unity in

GF(qm),

and let

mi(x)

be the minimal polynomial over

GF(q)

of

\alphai

for all

i.

The generator polynomial of the BCH code is defined as the least common multiple

g(x)={\rmlcm}(mc(x),\ldots,mc+d-2(x)).

Note: if

n=qm-1

as in the simplified definition, then

{\rmgcd}(n,q)

is 1, and the order of

q

modulo

n

is

m.

Therefore, the simplified definition is indeed a special case of the general one.

Special cases

c=1

is called a narrow-sense BCH code.

n=qm-1

is called primitive.

The generator polynomial

g(x)

of a BCH code has coefficients from

GF(q).

In general, a cyclic code over

GF(qp)

with

g(x)

as the generator polynomial is called a BCH code over

GF(qp).

The BCH code over

GF(qm)

and generator polynomial

g(x)

with successive powers of

\alpha

as roots is one type of Reed–Solomon code where the decoder (syndromes) alphabet is the same as the channel (data and generator polynomial) alphabet, all elements of

GF(qm)

. The other type of Reed Solomon code is an original view Reed Solomon code which is not a BCH code.

Properties

The generator polynomial of a BCH code has degree at most

(d-1)m

. Moreover, if

q=2

and

c=1

, the generator polynomial has degree at most

dm/2

.Each minimal polynomial

mi(x)

has degree at most

m

. Therefore, the least common multiple of

d-1

of them has degree at most

(d-1)m

. Moreover, if

q=2,

then

mi(x)=m2i(x)

for all

i

. Therefore,

g(x)

is the least common multiple of at most

d/2

minimal polynomials

mi(x)

for odd indices

i,

each of degree at most

m

.

A BCH code has minimal Hamming distance at least

d

.Suppose that

p(x)

is a code word with fewer than

d

non-zero terms. Then

p(x)=

k1
b
1x

++bd-1

kd-1
x

,wherek1<k2<<kd-1.

Recall that

\alphac,\ldots,\alphac+d-2

are roots of

g(x),

hence of

p(x)

. This implies that

b1,\ldots,bd-1

satisfy the following equations, for each

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

is seen to be a Vandermonde matrix, and its determinant is

\det(V)=\prod1\le

kj
\left(\alpha

-

ki
\alpha

\right),

which is non-zero. It therefore follows that

b1,\ldots,bd-1=0,

hence

p(x)=0.

A BCH code is cyclic.A polynomial code of length

n

is cyclic if and only if its generator polynomial divides

xn-1.

Since

g(x)

is the minimal polynomial with roots

\alphac,\ldots,\alphac+d-2,

it suffices to check that each of

\alphac,\ldots,\alphac+d-2

is a root of

xn-1.

This follows immediately from the fact that

\alpha

is, by definition, an

n

th root of unity.

Encoding

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.

Non-systematic encoding: The message as a factor

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

, chosen for use in the (31, 21) binary BCH code used by POCSAG and others. To encode the 21-bit message, we first represent it as a polynomial over

GF(2)

:

p(x)=x20+x18+x17+x15+x14+x13+x11+x10+x9+x8+x6+x5+x4+x3+x2+1

Then, compute (also over

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}

Thus, the transmitted codeword is .

The receiver can use these bits as coefficients in

s(x)

and, after error-correction to ensure a valid codeword, can recompute

p(x)=s(x)/g(x)

Systematic encoding: The message as a prefix

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)

is divisible by

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)

as before and multiply it by

xn-k

(to "shift" the message out of the way of the remainder), we can then use Euclidean division of polynomials to yield:

p(x)xn-k=q(x)g(x)+r(x)

Here, we see that

q(x)g(x)

is a valid codeword. As

r(x)

is always of degree less than

n-k

(which is the degree of

g(x)

), we can safely subtract it from

p(x)xn-k

without altering any of the message coefficients, hence we have our

s(x)

as

s(x)=q(x)g(x)=p(x)xn-k-r(x)

Over

GF(2)

(i.e. with binary BCH codes), this process is indistinguishable from appending a cyclic redundancy check, and if a systematic binary BCH code is used only for error-detection purposes, we see that BCH codes are just a generalization of the mathematics of cyclic redundancy checks.

The advantage to the systematic coding is that the receiver can recover the original message by discarding everything after the first

k

coefficients, after performing error correction.

Decoding

There are many algorithms for decoding BCH codes. The most common ones follow this general outline:

  1. Calculate the syndromes sj for the received vector
  2. Determine the number of errors t and the error locator polynomial Λ(x) from the syndromes
  3. Calculate the roots of the error location polynomial to find the error locations Xi
  4. Calculate the error values Yi at those error locations
  5. Correct the errors

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.

Calculate the syndromes

The received vector

R

is the sum of the correct codeword

C

and an unknown error vector

E.

The syndrome values are formed by considering

R

as a polynomial and evaluating it at

\alphac,\ldots,\alphac+d-2.

Thus the syndromes are

sj=R\left(\alphaj\right)=C\left(\alphaj\right)+E\left(\alphaj\right)

for

j=c

to

c+d-2.

Since

\alphaj

are the zeros of

g(x),

of which

C(x)

is a multiple,

C\left(\alphaj\right)=0.

Examining the syndrome values thus isolates the error vector so one can begin to solve for it.

If there is no error,

sj=0

for all

j.

If the syndromes are all zero, then the decoding is done.

Calculate the error location polynomial

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,

where

i

is the location of the error and

e

is its magnitude. Then the first two syndromes are

\begin{align} sc&=e\alphaci\\ sc+1&=e\alpha(c+1)i=\alphaisc \end{align}

so together they allow us to calculate

e

and provide some information about

i

(completely determining it in the case of Reed–Solomon codes).

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

and

ik.

The first step is finding, compatible with computed syndromes and with minimal possible

t,

locator polynomial:

Λ(x)=

t
\prod
j=1
ij
\left(x\alpha

-1\right)

Three popular algorithms for this task are:

  1. Peterson–Gorenstein–Zierler algorithm
  2. Berlekamp–Massey algorithm
  3. Sugiyama Euclidean algorithm

Peterson–Gorenstein–Zierler algorithm

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

of a polynomial

Λ(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.

Factor error locator polynomial

Now that you have the

Λ(x)

polynomial, its roots can be found in the form

Λ(x)=

i1
\left(\alpha

x-

i2
1\right)\left(\alpha

x-1\right)

iv
\left(\alpha

x-1\right)

by brute force for example using the Chien search algorithm. The exponentialpowers of the primitive element

\alpha

will yield the positions where errors occur in the received word; hence the name 'error locator' polynomial.

The zeros of Λ(x) are αi1, …, αiv.

Calculate error values

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

can be determined by solving the linear system

\begin{align} sc&=e1

ci1
\alpha

+e2

ci2
\alpha

+\\ sc+1&=e1

(c+1)i1
\alpha

+e2

(c+1)i2
\alpha

+\\ &{}\vdots \end{align}

Forney algorithm

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,λ00    Λ(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

ix:=

i
\sum
k=1

x.

Than if syndromes could be explained by an error word, which could be nonzero only on positions

ik

, then error values are

ek=

ik
-{\alpha
-ik
\Omega\left(\alpha

\right)\over

cik
\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)}.

Explanation of Forney algorithm computation

It is based on Lagrange interpolation and techniques of generating functions.

Consider

S(x)Λ(x),

and for the sake of simplicity suppose

λk=0

for

k>v,

and

sk=0

for

k>c+d-2.

Then

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
\left(x
ij
\alpha
\right)d-1-1
x
ij
\alpha
-1

\right\}\left\{λ0

v
\prod
\ell=1

\left

i\ell
(\alpha

x-1\right)\right\}\\ &=λ0

v
\sum
j=1
cij
e
j\alpha
\left
ij
(x\alpha
\right)d-1-1
ij
x\alpha-1
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,

and we could simplify the context by removing the
ij
\left(x\alpha

\right)d-1

terms. This leads to the error evaluator polynomial

\Omega(x)\equivS(x)Λ(x)\bmod{xd-1

}.

Thanks to

v\leqslantd-1

we have

\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

Λ

(the Lagrange interpolation trick) the sum degenerates to only one summand for

x=

-ik
\alpha

\Omega

-ik
\left(\alpha

\right)=0

cik
e
k\alpha

\prod\ell\in\{1,,v\\setminus\{k\}}

i\ell
\left(\alpha
-ik
\alpha

-1\right).

To get

ek

we just should get rid of the product. We could compute the product directly from already computed roots
-ij
\alpha
of

Λ,

but we could use simpler form.

As formal derivative

Λ'(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=-

ik
\alpha\Omega
-ik
\left(\alpha
\right)
cik
\alphaΛ'
-ik
\left(\alpha
\right)

.

This formula is advantageous when one computes the formal derivative of

Λ

form

Λ(x)=

v
\sum
i=1

λixi

yielding:

Λ'(x)=

v
\sum
i=1

iλixi-1,

where

ix:=

i
\sum
k=1

x.

Decoding based on extended Euclidean algorithm

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

be positions of unreadable characters. One creates polynomial localising these positions

\Gamma(x)=

k\left(x\alpha
\prod
i=1
ki

-1\right).

Set values on unreadable positions to 0 and compute the syndromes.

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)

and

xd-1.

The goal is not to find the least common divisor, but a polynomial

r(x)

of degree at most

\lfloor(d+k-3)/2\rfloor

and polynomials

a(x),b(x)

such that

r(x)=a(x)S(x)\Gamma(x)+b(x)xd-1.

Low degree of

r(x)

guarantees, that

a(x)

would satisfy extended (by

\Gamma

) defining conditions for

Λ.

Defining

\Xi(x)=a(x)\Gamma(x)

and using

\Xi

on the place of

Λ(x)

in the Fourney formula will give us error values.

The main advantage of the algorithm is that it meanwhile computes

\Omega(x)=S(x)\Xi(x)\bmodxd-1=r(x)

required in the Forney formula.

Explanation of the decoding process

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

restricts error word by condition

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

to

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,

we could replace set of syndromes

\{sc,,sc+d-2\}

by set of syndromes

\{tc,,tc+d-3\}

defined by equation
k1
t
i=\alpha

si-si+1.

Suppose for an error word all restrictions by original set

\{sc,,sc+d-2\}

of syndromes hold,than
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.

Except the coordinate

k1,

where we have
f
k1

=0,

an

fj

is zero, if

ej=0.

For the goal of locating error positions we could change the set of syndromes in the similar way to reflect all unreadable characters. This shortens the set of syndromes by

k.

In polynomial formulation, the replacement of syndromes set

\{sc,,sc+d-2\}

by syndromes set

\{tc,,tc+d-3\}

leads to

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)

by

S(x)\Gamma(x)

, one would require equation for coefficients near powers

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

positions such that eliminating their influence leads to obtaining set of syndromes consisting of all zeros, than there exists error vector with errors only on these coordinates.If

Λ(x)

denotes the polynomial eliminating the influence of these coordinates, we obtain

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)

errors (on readable positions), because with bigger error count there could be more codewords in the same distance from the received word. Therefore, for

Λ(x)

we are looking for, the equation must hold for coefficients near powers starting from

k+\left\lfloor

1
2

(d-1-k)\right\rfloor.

In Forney formula,

Λ(x)

could be multiplied by a scalar giving the same result.

It could happen that the Euclidean algorithm finds

Λ(x)

of degree higher than

\tfrac{1}{2}(d-1-k)

having number of different roots equal to its degree, where the Fourney formula would be able to correct errors in all its roots, anyway correcting such many errors could be risky (especially with no other restrictions on received word). Usually after getting

Λ(x)

of higher degree, we decide not to correct the errors. Correction could fail in the case

Λ(x)

has roots with higher multiplicity or the number of roots is smaller than its degree. Fail could be detected as well by Forney formula returning error outside the transmitted alphabet.

Correct the errors

Using the error values and error location, correct the errors and form a corrected code vector by subtracting error values at error locations.

Decoding examples

Decoding of binary code without unreadable characters

Consider a BCH code in GF(24) with

d=7

and

g(x)=x10+x8+x5+x4+x2+x+1

. (This is used in QR codes.) Let the message to be transmitted be [1 1 0 1 1], or in polynomial notation,

M(x)=x4+x3+x+1.

The "checksum" symbols are calculated by dividing

x10M(x)

by

g(x)

and taking the remainder, resulting in

x9+x4+x2

or [ 1 0 0 0 0 1 0 1 0 0 ]. These are appended to the message, so the transmitted codeword is [ 1 1 0 1 1 1 0 0 0 0 1 0 1 0 0 ].

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

In order to correct the errors, first calculate the syndromes. Taking

\alpha=0010,

we have

s1=R(\alpha1)=1011,

s2=1001,

s3=1011,

s4=1101,

s5=0001,

and

s6=1001.

Next, apply the Peterson procedure by row-reducing the following augmented matrix.

\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}

Due to the zero row, is singular, which is no surprise since only two errors were introduced into the codeword.However, the upper-left corner of the matrix is identical to

Notes and References

  1. Web site: Phobos Lander Coding System: Software and Analysis. https://ghostarchive.org/archive/20221009/http://ipnpr.jpl.nasa.gov/progress_report/42-94/94V.PDF . 2022-10-09 . live. 25 February 2012.
  2. Book: BCH Codes for Solid-State-Drives. 10.1007/978-981-13-0599-3_11 . https://link.springer.com/chapter/10.1007/978-981-13-0599-3_11. 23 September 2023 . Inside Solid State Drives (SSDS) . Springer Series in Advanced Microelectronics . 2018 . Marelli . Alessia . Micheloni . Rino . 37 . 369–406 . 978-981-13-0598-6 .
  3. Yasuo Sugiyama, Masao Kasahara, Shigeichi Hirasawa, and Toshihiko Namekawa. A method for solving key equation for decoding Goppa codes. Information and Control, 27:87–99, 1975.