fbpx
Wikipedia

BCH code

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 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.[1][2][3] 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,[4] compact disc players, DVDs, disk drives, USB flash drives, solid-state drives,[5] quantum-resistant cryptography[6] and two-dimensional bar codes.

Definition and illustration

Primitive narrow-sense BCH codes

Given a prime number q and prime power qm with positive integers m and d such that dqm − 1, a primitive narrow-sense BCH code over the finite field (or Galois field) GF(q) with code length n = qm − 1 and distance at least d is constructed by the following method.

Let α be a primitive element of GF(qm). For any positive integer i, let mi(x) be the minimal polynomial with coefficients in GF(q) of αi. The generator polynomial of the BCH code is defined as the least common multiple g(x) = lcm(m1(x),…,md − 1(x)). It can be seen that g(x) is a polynomial with coefficients in GF(q) and divides xn − 1. Therefore, the polynomial code defined by g(x) is a cyclic code.

Example

Let q = 2 and m = 4 (therefore n = 15). We will consider different values of d for GF(16) = GF(24) based on the reducing polynomial z4 + z + 1, using primitive element α(z) = z. There are fourteen minimum polynomials mi(x) with coefficients in GF(2) satisfying

 

The minimal polynomials are

 

The BCH code with   has generator polynomial

 

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.

The BCH code with   has generator polynomial

 

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.

The BCH code with   has generator polynomial

 

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. (This particular generator polynomial has a real-world application, in the format patterns of the QR code.)

The BCH code with   and higher has generator polynomial

 

This code has minimal Hamming distance 15 and corrects 7 errors. It has 1 data bit and 14 checksum bits. In fact, this code has only two codewords: 000000000000000 and 111111111111111.

General BCH codes

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

First, the requirement that   be a primitive element of   can be relaxed. By relaxing this requirement, the code length changes from   to   the order of the element  

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

Definition. Fix a finite field   where   is a prime power. Choose positive integers   such that     and   is the multiplicative order of   modulo  

As before, let   be a primitive  th root of unity in   and let   be the minimal polynomial over   of   for all   The generator polynomial of the BCH code is defined as the least common multiple  

Note: if   as in the simplified definition, then   is 1, and the order of   modulo   is   Therefore, the simplified definition is indeed a special case of the general one.

Special cases

  • A BCH code with   is called a narrow-sense BCH code.
  • A BCH code with   is called primitive.

The generator polynomial   of a BCH code has coefficients from   In general, a cyclic code over   with   as the generator polynomial is called a BCH code over   The BCH code over   and generator polynomial   with successive powers of   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   .[7] 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  . Moreover, if   and  , the generator polynomial has degree at most  .

Proof

Each minimal polynomial   has degree at most  . Therefore, the least common multiple of   of them has degree at most  . Moreover, if   then   for all  . Therefore,   is the least common multiple of at most   minimal polynomials   for odd indices   each of degree at most  .

A BCH code has minimal Hamming distance at least  .

Proof

Suppose that   is a code word with fewer than   non-zero terms. Then

 

Recall that   are roots of   hence of  . This implies that   satisfy the following equations, for each  :

 

In matrix form, we have

 

The determinant of this matrix equals

 

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

 

which is non-zero. It therefore follows that   hence  

A BCH code is cyclic.

Proof

A polynomial code of length   is cyclic if and only if its generator polynomial divides   Since   is the minimal polynomial with roots   it suffices to check that each of   is a root of   This follows immediately from the fact that   is, by definition, an  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.

 

As an example, consider the generator polynomial  , chosen for use in the (31, 21) binary BCH code used by POCSAG and others. To encode the 21-bit message {101101110111101111101}, we first represent it as a polynomial over  :

 

Then, compute (also over  ):

 

Thus, the transmitted codeword is {1100111010010111101011101110101}.

The receiver can use these bits as coefficients in   and, after error-correction to ensure a valid codeword, can recompute  

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   is divisible by  .

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   as before and multiply it by   (to "shift" the message out of the way of the remainder), we can then use Euclidean division of polynomials to yield:

 

Here, we see that   is a valid codeword. As   is always of degree less than   (which is the degree of  ), we can safely subtract it from   without altering any of the message coefficients, hence we have our   as

 

Over   (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   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   is the sum of the correct codeword   and an unknown error vector   The syndrome values are formed by considering   as a polynomial and evaluating it at   Thus the syndromes are[8]

 

for   to  

Since   are the zeros of   of which   is a multiple,   Examining the syndrome values thus isolates the error vector so one can begin to solve for it.

If there is no error,   for all   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   where   is the location of the error and   is its magnitude. Then the first two syndromes are

 

so together they allow us to calculate   and provide some information about   (completely determining it in the case of Reed–Solomon codes).

If there are two or more errors,

 

It is not immediately obvious how to begin solving the resulting syndromes for the unknowns   and  

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

 

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   of a polynomial

 

Now the procedure of the Peterson–Gorenstein–Zierler algorithm.[9] Expect we have at least 2t syndromes sc, …, sc+2t−1. Let v = t.

  1. Start by generating the   matrix with elements that are syndrome values
     
  2. Generate a   vector with elements
     
  3. Let   denote the unknown polynomial coefficients, which are given by
     
  4. Form the matrix equation
     
  5. If the determinant of matrix   is nonzero, then we can actually find an inverse of this matrix and solve for the values of unknown   values.
  6. If   then follow
     if   then declare an empty error locator polynomial stop Peterson procedure. end set   
    continue from the beginning of Peterson's decoding by making smaller  
  7. After you have values of  , you have the error locator polynomial.
  8. Stop Peterson procedure.

Factor error locator polynomial

Now that you have the   polynomial, its roots can be found in the form   by brute force for example using the Chien search algorithm. The exponential powers of the primitive element   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   can be determined by solving the linear system

 

Forney algorithm

However, there is a more efficient method known as the Forney algorithm.

Let

 
 

And the error evaluator polynomial[10]

 

Finally:

 

where

 

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

 

For narrow-sense BCH codes, c = 1, so the expression simplifies to:

 

Explanation of Forney algorithm computation

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

Consider   and for the sake of simplicity suppose   for   and   for   Then

 
 

We want to compute unknowns   and we could simplify the context by removing the   terms. This leads to the error evaluator polynomial

 

Thanks to   we have

 

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

 

To get   we just should get rid of the product. We could compute the product directly from already computed roots   of   but we could use simpler form.

As formal derivative

 

we get again only one summand in

 

So finally

 

This formula is advantageous when one computes the formal derivative of   form

 

yielding:

 

where

 

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.[11] Correction of unreadable characters could be incorporated to the algorithm easily as well.

Let   be positions of unreadable characters. One creates polynomial localising these positions   Set values on unreadable positions to 0 and compute the syndromes.

As we have already defined for the Forney formula let  

Let us run extended Euclidean algorithm for locating least common divisor of polynomials   and   The goal is not to find the least common divisor, but a polynomial   of degree at most   and polynomials   such that   Low degree of   guarantees, that   would satisfy extended (by  ) defining conditions for  

Defining   and using   on the place of   in the Fourney formula will give us error values.

The main advantage of the algorithm is that it meanwhile computes   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   restricts error word by condition

 

We could write these conditions separately or we could create polynomial

 

and compare coefficients near powers   to  

 

Suppose there is unreadable letter on position   we could replace set of syndromes   by set of syndromes   defined by equation   Suppose for an error word all restrictions by original set   of syndromes hold, than

 

New set of syndromes restricts error vector

 

the same way the original set of syndromes restricted the error vector   Except the coordinate   where we have   an   is zero, if   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  

In polynomial formulation, the replacement of syndromes set   by syndromes set   leads to

 

Therefore,

 

After replacement of   by  , one would require equation for coefficients near powers  

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   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   denotes the polynomial eliminating the influence of these coordinates, we obtain

 

In Euclidean algorithm, we try to correct at most   errors (on readable positions), because with bigger error count there could be more codewords in the same distance from the received word. Therefore, for   we are looking for, the equation must hold for coefficients near powers starting from

 

In Forney formula,   could be multiplied by a scalar giving the same result.

It could happen that the Euclidean algorithm finds   of degree higher than   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   of higher degree, we decide not to correct the errors. Correction could fail in the case   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   and  . (This is used in QR codes.) Let the message to be transmitted be [1 1 0 1 1], or in polynomial notation,   The "checksum" symbols are calculated by dividing   by   and taking the remainder, resulting in   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 0 0 1 1 1 0 0 0 1 1 0 1 0 0 ]. In polynomial notation:

 

In order to correct the errors, first calculate the syndromes. Taking   we have           and   Next, apply the Peterson procedure by row-reducing the following augmented matrix.

 

Due to the zero row, S3×3 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 [S2×2 | C2×1], which gives rise to the solution     The resulting error locator polynomial is   which has zeros at   and   The exponents of   correspond to the error locations. There is no need to calculate the error values in this example, as the only possible value is 1.

Decoding with unreadable characters

Suppose the same scenario, but the received word has two unreadable characters [ 1 0 0 ? 1 1 ? 0 0 1 1 0 1 0 0 ]. We replace the unreadable characters by zeros while creating the polynomial reflecting their positions   We compute the syndromes   and   (Using log notation which is independent on GF(24) isomorphisms. For computation checking we can use the same representation for addition as was used in previous example. Hexadecimal description of the powers of   are consecutively 1,2,4,8,3,6,C,B,5,A,7,E,F,D,9 with the addition based on bitwise xor.)

Let us make syndrome polynomial

 

compute

 

Run the extended Euclidean algorithm:

code, coding, theory, bose, chaudhuri, hocquenghem, codes, form, class, cyclic, error, correcting, codes, that, constructed, using, polynomials, over, finite, field, also, called, galois, field, were, invented, 1959, french, mathematician, alexis, hocquenghem,. 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 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 1 2 3 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 4 compact disc players DVDs disk drives USB flash drives solid state drives 5 quantum resistant cryptography 6 and two dimensional bar codes Contents 1 Definition and illustration 1 1 Primitive narrow sense BCH codes 1 1 1 Example 1 2 General BCH codes 1 3 Special cases 2 Properties 3 Encoding 3 1 Non systematic encoding The message as a factor 3 2 Systematic encoding The message as a prefix 4 Decoding 4 1 Calculate the syndromes 4 2 Calculate the error location polynomial 4 2 1 Peterson Gorenstein Zierler algorithm 4 3 Factor error locator polynomial 4 4 Calculate error values 4 4 1 Forney algorithm 4 4 2 Explanation of Forney algorithm computation 4 5 Decoding based on extended Euclidean algorithm 4 5 1 Explanation of the decoding process 4 6 Correct the errors 4 7 Decoding examples 4 7 1 Decoding of binary code without unreadable characters 4 7 2 Decoding with unreadable characters 4 7 3 Decoding with unreadable characters with a small number of errors 5 Citations 6 References 6 1 Primary sources 6 2 Secondary sources 7 Further readingDefinition and illustration EditPrimitive narrow sense BCH codes Edit Given a prime number q and prime power qm with positive integers m and d such that d qm 1 a primitive narrow sense BCH code over the finite field or Galois field GF q with code length n qm 1 and distance at least d is constructed by the following method Let a be a primitive element of GF qm For any positive integer i let mi x be the minimal polynomial with coefficients in GF q of ai The generator polynomial of the BCH code is defined as the least common multiple g x lcm m1 x md 1 x It can be seen that g x is a polynomial with coefficients in GF q and divides xn 1 Therefore the polynomial code defined by g x is a cyclic code Example Edit Let q 2 and m 4 therefore n 15 We will consider different values of d for GF 16 GF 24 based on the reducing polynomial z4 z 1 using primitive element a z z There are fourteen minimum polynomials mi x with coefficients in GF 2 satisfying m i a i mod z 4 z 1 0 displaystyle m i left alpha i right bmod left z 4 z 1 right 0 The minimal polynomials are m 1 x m 2 x m 4 x m 8 x x 4 x 1 m 3 x m 6 x m 9 x m 12 x x 4 x 3 x 2 x 1 m 5 x m 10 x x 2 x 1 m 7 x m 11 x m 13 x m 14 x x 4 x 3 1 displaystyle begin aligned m 1 x amp m 2 x m 4 x m 8 x x 4 x 1 m 3 x amp m 6 x m 9 x m 12 x x 4 x 3 x 2 x 1 m 5 x amp m 10 x x 2 x 1 m 7 x amp m 11 x m 13 x m 14 x x 4 x 3 1 end aligned The BCH code with d 2 3 displaystyle d 2 3 has generator polynomial g x l c m m 1 x m 2 x m 1 x x 4 x 1 displaystyle g x rm lcm m 1 x m 2 x m 1 x x 4 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 The BCH code with d 4 5 displaystyle d 4 5 has generator polynomial g x l c m m 1 x m 2 x m 3 x m 4 x m 1 x m 3 x x 4 x 1 x 4 x 3 x 2 x 1 x 8 x 7 x 6 x 4 1 displaystyle begin aligned g x amp rm lcm m 1 x m 2 x m 3 x m 4 x m 1 x m 3 x amp left x 4 x 1 right left x 4 x 3 x 2 x 1 right x 8 x 7 x 6 x 4 1 end aligned 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 The BCH code with d 6 7 displaystyle d 6 7 has generator polynomial g x l c m m 1 x m 2 x m 3 x m 4 x m 5 x m 6 x m 1 x m 3 x m 5 x x 4 x 1 x 4 x 3 x 2 x 1 x 2 x 1 x 10 x 8 x 5 x 4 x 2 x 1 displaystyle begin aligned g x amp rm lcm m 1 x m 2 x m 3 x m 4 x m 5 x m 6 x m 1 x m 3 x m 5 x amp left x 4 x 1 right left x 4 x 3 x 2 x 1 right left x 2 x 1 right x 10 x 8 x 5 x 4 x 2 x 1 end aligned 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 This particular generator polynomial has a real world application in the format patterns of the QR code The BCH code with d 8 displaystyle d 8 and higher has generator polynomial g x l c m m 1 x m 2 x m 14 x m 1 x m 3 x m 5 x m 7 x x 4 x 1 x 4 x 3 x 2 x 1 x 2 x 1 x 4 x 3 1 x 14 x 13 x 12 x 2 x 1 displaystyle begin aligned g x amp rm lcm m 1 x m 2 x m 14 x m 1 x m 3 x m 5 x m 7 x amp left x 4 x 1 right left x 4 x 3 x 2 x 1 right left x 2 x 1 right left x 4 x 3 1 right x 14 x 13 x 12 cdots x 2 x 1 end aligned This code has minimal Hamming distance 15 and corrects 7 errors It has 1 data bit and 14 checksum bits In fact this code has only two codewords 000000000000000 and 111111111111111 General BCH codes Edit General BCH codes differ from primitive narrow sense BCH codes in two respects First the requirement that a displaystyle alpha be a primitive element of G F q m displaystyle mathrm GF q m can be relaxed By relaxing this requirement the code length changes from q m 1 displaystyle q m 1 to o r d a displaystyle mathrm ord alpha the order of the element a displaystyle alpha Second the consecutive roots of the generator polynomial may run from a c a c d 2 displaystyle alpha c ldots alpha c d 2 instead of a a d 1 displaystyle alpha ldots alpha d 1 Definition Fix a finite field G F q displaystyle GF q where q displaystyle q is a prime power Choose positive integers m n d c displaystyle m n d c such that 2 d n displaystyle 2 leq d leq n g c d n q 1 displaystyle rm gcd n q 1 and m displaystyle m is the multiplicative order of q displaystyle q modulo n displaystyle n As before let a displaystyle alpha be a primitive n displaystyle n th root of unity in G F q m displaystyle GF q m and let m i x displaystyle m i x be the minimal polynomial over G F q displaystyle GF q of a i displaystyle alpha i for all i displaystyle i The generator polynomial of the BCH code is defined as the least common multiple g x l c m m c x m c d 2 x displaystyle g x rm lcm m c x ldots m c d 2 x Note if n q m 1 displaystyle n q m 1 as in the simplified definition then g c d n q displaystyle rm gcd n q is 1 and the order of q displaystyle q modulo n displaystyle n is m displaystyle m Therefore the simplified definition is indeed a special case of the general one Special cases Edit A BCH code with c 1 displaystyle c 1 is called a narrow sense BCH code A BCH code with n q m 1 displaystyle n q m 1 is called primitive The generator polynomial g x displaystyle g x of a BCH code has coefficients from G F q displaystyle mathrm GF q In general a cyclic code over G F q p displaystyle mathrm GF q p with g x displaystyle g x as the generator polynomial is called a BCH code over G F q p displaystyle mathrm GF q p The BCH code over G F q m displaystyle mathrm GF q m and generator polynomial g x displaystyle g x with successive powers of a displaystyle 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 G F q m displaystyle mathrm GF q m 7 The other type of Reed Solomon code is an original view Reed Solomon code which is not a BCH code Properties EditThe generator polynomial of a BCH code has degree at most d 1 m displaystyle d 1 m Moreover if q 2 displaystyle q 2 and c 1 displaystyle c 1 the generator polynomial has degree at most d m 2 displaystyle dm 2 ProofEach minimal polynomial m i x displaystyle m i x has degree at most m displaystyle m Therefore the least common multiple of d 1 displaystyle d 1 of them has degree at most d 1 m displaystyle d 1 m Moreover if q 2 displaystyle q 2 then m i x m 2 i x displaystyle m i x m 2i x for all i displaystyle i Therefore g x displaystyle g x is the least common multiple of at most d 2 displaystyle d 2 minimal polynomials m i x displaystyle m i x for odd indices i displaystyle i each of degree at most m displaystyle m A BCH code has minimal Hamming distance at least d displaystyle d ProofSuppose that p x displaystyle p x is a code word with fewer than d displaystyle d non zero terms Then p x b 1 x k 1 b d 1 x k d 1 where k 1 lt k 2 lt lt k d 1 displaystyle p x b 1 x k 1 cdots b d 1 x k d 1 text where k 1 lt k 2 lt cdots lt k d 1 Recall that a c a c d 2 displaystyle alpha c ldots alpha c d 2 are roots of g x displaystyle g x hence of p x displaystyle p x This implies that b 1 b d 1 displaystyle b 1 ldots b d 1 satisfy the following equations for each i c c d 2 displaystyle i in c dotsc c d 2 p a i b 1 a i k 1 b 2 a i k 2 b d 1 a i k d 1 0 displaystyle p alpha i b 1 alpha ik 1 b 2 alpha ik 2 cdots b d 1 alpha ik d 1 0 In matrix form we have a c k 1 a c k 2 a c k d 1 a c 1 k 1 a c 1 k 2 a c 1 k d 1 a c d 2 k 1 a c d 2 k 2 a c d 2 k d 1 b 1 b 2 b d 1 0 0 0 displaystyle begin bmatrix alpha ck 1 amp alpha ck 2 amp cdots amp alpha ck d 1 alpha c 1 k 1 amp alpha c 1 k 2 amp cdots amp alpha c 1 k d 1 vdots amp vdots amp amp vdots alpha c d 2 k 1 amp alpha c d 2 k 2 amp cdots amp alpha c d 2 k d 1 end bmatrix begin bmatrix b 1 b 2 vdots b d 1 end bmatrix begin bmatrix 0 0 vdots 0 end bmatrix The determinant of this matrix equals i 1 d 1 a c k i det 1 1 1 a k 1 a k 2 a k d 1 a d 2 k 1 a d 2 k 2 a d 2 k d 1 i 1 d 1 a c k i det V displaystyle left prod i 1 d 1 alpha ck i right det begin pmatrix 1 amp 1 amp cdots amp 1 alpha k 1 amp alpha k 2 amp cdots amp alpha k d 1 vdots amp vdots amp amp vdots alpha d 2 k 1 amp alpha d 2 k 2 amp cdots amp alpha d 2 k d 1 end pmatrix left prod i 1 d 1 alpha ck i right det V The matrix V displaystyle V is seen to be a Vandermonde matrix and its determinant is det V 1 i lt j d 1 a k j a k i displaystyle det V prod 1 leq i lt j leq d 1 left alpha k j alpha k i right which is non zero It therefore follows that b 1 b d 1 0 displaystyle b 1 ldots b d 1 0 hence p x 0 displaystyle p x 0 A BCH code is cyclic ProofA polynomial code of length n displaystyle n is cyclic if and only if its generator polynomial divides x n 1 displaystyle x n 1 Since g x displaystyle g x is the minimal polynomial with roots a c a c d 2 displaystyle alpha c ldots alpha c d 2 it suffices to check that each of a c a c d 2 displaystyle alpha c ldots alpha c d 2 is a root of x n 1 displaystyle x n 1 This follows immediately from the fact that a displaystyle alpha is by definition an n displaystyle n th root of unity Encoding EditBecause 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 Edit 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 displaystyle s x p x g x As an example consider the generator polynomial g x x 10 x 9 x 8 x 6 x 5 x 3 1 displaystyle g x x 10 x 9 x 8 x 6 x 5 x 3 1 chosen for use in the 31 21 binary BCH code used by POCSAG and others To encode the 21 bit message 101101110111101111101 we first represent it as a polynomial over G F 2 displaystyle GF 2 p x x 20 x 18 x 17 x 15 x 14 x 13 x 11 x 10 x 9 x 8 x 6 x 5 x 4 x 3 x 2 1 displaystyle p x x 20 x 18 x 17 x 15 x 14 x 13 x 11 x 10 x 9 x 8 x 6 x 5 x 4 x 3 x 2 1 Then compute also over G F 2 displaystyle GF 2 s x p x g x x 20 x 18 x 17 x 15 x 14 x 13 x 11 x 10 x 9 x 8 x 6 x 5 x 4 x 3 x 2 1 x 10 x 9 x 8 x 6 x 5 x 3 1 x 30 x 29 x 26 x 25 x 24 x 22 x 19 x 17 x 16 x 15 x 14 x 12 x 10 x 9 x 8 x 6 x 5 x 4 x 2 1 displaystyle begin aligned s x amp p x g x amp left x 20 x 18 x 17 x 15 x 14 x 13 x 11 x 10 x 9 x 8 x 6 x 5 x 4 x 3 x 2 1 right left x 10 x 9 x 8 x 6 x 5 x 3 1 right amp x 30 x 29 x 26 x 25 x 24 x 22 x 19 x 17 x 16 x 15 x 14 x 12 x 10 x 9 x 8 x 6 x 5 x 4 x 2 1 end aligned Thus the transmitted codeword is 1100111010010111101011101110101 The receiver can use these bits as coefficients in s x displaystyle s x and after error correction to ensure a valid codeword can recompute p x s x g x displaystyle p x s x g x Systematic encoding The message as a prefix Edit 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 displaystyle s x is divisible by g x displaystyle 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 displaystyle p x as before and multiply it by x n k displaystyle x n k to shift the message out of the way of the remainder we can then use Euclidean division of polynomials to yield p x x n k q x g x r x displaystyle p x x n k q x g x r x Here we see that q x g x displaystyle q x g x is a valid codeword As r x displaystyle r x is always of degree less than n k displaystyle n k which is the degree of g x displaystyle g x we can safely subtract it from p x x n k displaystyle p x x n k without altering any of the message coefficients hence we have our s x displaystyle s x as s x q x g x p x x n k r x displaystyle s x q x g x p x x n k r x Over G F 2 displaystyle 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 displaystyle k coefficients after performing error correction Decoding EditThere are many algorithms for decoding BCH codes The most common ones follow this general outline Calculate the syndromes sj for the received vector Determine the number of errors t and the error locator polynomial L x from the syndromes Calculate the roots of the error location polynomial to find the error locations Xi Calculate the error values Yi at those error locations Correct the errorsDuring 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 Edit The received vector R displaystyle R is the sum of the correct codeword C displaystyle C and an unknown error vector E displaystyle E The syndrome values are formed by considering R displaystyle R as a polynomial and evaluating it at a c a c d 2 displaystyle alpha c ldots alpha c d 2 Thus the syndromes are 8 s j R a j C a j E a j displaystyle s j R left alpha j right C left alpha j right E left alpha j right for j c displaystyle j c to c d 2 displaystyle c d 2 Since a j displaystyle alpha j are the zeros of g x displaystyle g x of which C x displaystyle C x is a multiple C a j 0 displaystyle C left alpha j right 0 Examining the syndrome values thus isolates the error vector so one can begin to solve for it If there is no error s j 0 displaystyle s j 0 for all j displaystyle j If the syndromes are all zero then the decoding is done Calculate the error location polynomial Edit 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 e x i displaystyle E x e x i where i displaystyle i is the location of the error and e displaystyle e is its magnitude Then the first two syndromes are s c e a c i s c 1 e a c 1 i a i s c displaystyle begin aligned s c amp e alpha c i s c 1 amp e alpha c 1 i alpha i s c end aligned so together they allow us to calculate e displaystyle e and provide some information about i displaystyle i completely determining it in the case of Reed Solomon codes If there are two or more errors E x e 1 x i 1 e 2 x i 2 displaystyle E x e 1 x i 1 e 2 x i 2 cdots It is not immediately obvious how to begin solving the resulting syndromes for the unknowns e k displaystyle e k and i k displaystyle i k The first step is finding compatible with computed syndromes and with minimal possible t displaystyle t locator polynomial L x j 1 t x a i j 1 displaystyle Lambda x prod j 1 t left x alpha i j 1 right Three popular algorithms for this task are Peterson Gorenstein Zierler algorithm Berlekamp Massey algorithm Sugiyama Euclidean algorithmPeterson Gorenstein Zierler algorithm Edit 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 l 1 l 2 l v displaystyle lambda 1 lambda 2 dots lambda v of a polynomial L x 1 l 1 x l 2 x 2 l v x v displaystyle Lambda x 1 lambda 1 x lambda 2 x 2 cdots lambda v x v Now the procedure of the Peterson Gorenstein Zierler algorithm 9 Expect we have at least 2t syndromes sc sc 2t 1 Let v t Start by generating the S v v displaystyle S v times v matrix with elements that are syndrome values S v v s c s c 1 s c v 1 s c 1 s c 2 s c v s c v 1 s c v s c 2 v 2 displaystyle S v times v begin bmatrix s c amp s c 1 amp dots amp s c v 1 s c 1 amp s c 2 amp dots amp s c v vdots amp vdots amp ddots amp vdots s c v 1 amp s c v amp dots amp s c 2v 2 end bmatrix Generate a c v 1 displaystyle c v times 1 vector with elements C v 1 s c v s c v 1 s c 2 v 1 displaystyle C v times 1 begin bmatrix s c v s c v 1 vdots s c 2v 1 end bmatrix Let L displaystyle Lambda denote the unknown polynomial coefficients which are given by L v 1 l v l v 1 l 1 displaystyle Lambda v times 1 begin bmatrix lambda v lambda v 1 vdots lambda 1 end bmatrix Form the matrix equation S v v L v 1 C v 1 displaystyle S v times v Lambda v times 1 C v times 1 If the determinant of matrix S v v displaystyle S v times v is nonzero then we can actually find an inverse of this matrix and solve for the values of unknown L displaystyle Lambda values If det S v v 0 displaystyle det left S v times v right 0 then follow if v 0 displaystyle v 0 then declare an empty error locator polynomial stop Peterson procedure end set v v 1 displaystyle v leftarrow v 1 continue from the beginning of Peterson s decoding by making smaller S v v displaystyle S v times v After you have values of L displaystyle Lambda you have the error locator polynomial Stop Peterson procedure Factor error locator polynomial Edit Now that you have the L x displaystyle Lambda x polynomial its roots can be found in the form L x a i 1 x 1 a i 2 x 1 a i v x 1 displaystyle Lambda x left alpha i 1 x 1 right left alpha i 2 x 1 right cdots left alpha i v x 1 right by brute force for example using the Chien search algorithm The exponential powers of the primitive element a displaystyle alpha will yield the positions where errors occur in the received word hence the name error locator polynomial The zeros of L x are a i1 a iv Calculate error values Edit 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 e j displaystyle e j can be determined by solving the linear system s c e 1 a c i 1 e 2 a c i 2 s c 1 e 1 a c 1 i 1 e 2 a c 1 i 2 displaystyle begin aligned s c amp e 1 alpha c i 1 e 2 alpha c i 2 cdots s c 1 amp e 1 alpha c 1 i 1 e 2 alpha c 1 i 2 cdots amp vdots end aligned Forney algorithm Edit However there is a more efficient method known as the Forney algorithm Let S x s c s c 1 x s c 2 x 2 s c d 2 x d 2 displaystyle S x s c s c 1 x s c 2 x 2 cdots s c d 2 x d 2 v d 1 l 0 0 L x i 0 v l i x i l 0 k 0 v a i k x 1 displaystyle v leqslant d 1 lambda 0 neq 0 qquad Lambda x sum i 0 v lambda i x i lambda 0 prod k 0 v left alpha i k x 1 right And the error evaluator polynomial 10 W x S x L x mod x d 1 displaystyle Omega x equiv S x Lambda x bmod x d 1 Finally L x i 1 v i l i x i 1 displaystyle Lambda x sum i 1 v i cdot lambda i x i 1 where i x k 1 i x displaystyle i cdot x sum k 1 i x Than if syndromes could be explained by an error word which could be nonzero only on positions i k displaystyle i k then error values are e k a i k W a i k a c i k L a i k displaystyle e k alpha i k Omega left alpha i k right over alpha c cdot i k Lambda left alpha i k right For narrow sense BCH codes c 1 so the expression simplifies to e k W a i k L a i k displaystyle e k Omega left alpha i k right over Lambda left alpha i k right Explanation of Forney algorithm computation Edit It is based on Lagrange interpolation and techniques of generating functions Consider S x L x displaystyle S x Lambda x and for the sake of simplicity suppose l k 0 displaystyle lambda k 0 for k gt v displaystyle k gt v and s k 0 displaystyle s k 0 for k gt c d 2 displaystyle k gt c d 2 Then S x L x j 0 i 0 j s j i 1 l i x j displaystyle S x Lambda x sum j 0 infty sum i 0 j s j i 1 lambda i x j S x L x S x l 0 ℓ 1 v a i ℓ x 1 i 0 d 2 j 1 v e j a c i i j x i l 0 ℓ 1 v a i ℓ x 1 j 1 v e j a c i j i 0 d 2 a i j i x i l 0 ℓ 1 v a i ℓ x 1 j 1 v e j a c i j x a i j d 1 1 x a i j 1 l 0 ℓ 1 v a i ℓ x 1 l 0 j 1 v e j a c i j x a i j d 1 1 x a i j 1 ℓ 1 v a i ℓ x 1 l 0 j 1 v e j a c i j x a i j d 1 1 ℓ 1 v j a i ℓ x 1 displaystyle begin aligned S x Lambda x amp S x left lambda 0 prod ell 1 v left alpha i ell x 1 right right amp left sum i 0 d 2 sum j 1 v e j alpha c i cdot i j x i right left lambda 0 prod ell 1 v left alpha i ell x 1 right right amp left sum j 1 v e j alpha ci j sum i 0 d 2 left alpha i j right i x i right left lambda 0 prod ell 1 v left alpha i ell x 1 right right amp left sum j 1 v e j alpha ci j frac left x alpha i j right d 1 1 x alpha i j 1 right left lambda 0 prod ell 1 v left alpha i ell x 1 right right amp lambda 0 sum j 1 v e j alpha ci j frac left x alpha i j right d 1 1 x alpha i j 1 prod ell 1 v left alpha i ell x 1 right amp lambda 0 sum j 1 v e j alpha ci j left left x alpha i j right d 1 1 right prod ell in 1 cdots v setminus j left alpha i ell x 1 right end aligned We want to compute unknowns e j displaystyle e j and we could simplify the context by removing the x a i j d 1 displaystyle left x alpha i j right d 1 terms This leads to the error evaluator polynomial W x S x L x mod x d 1 displaystyle Omega x equiv S x Lambda x bmod x d 1 Thanks to v d 1 displaystyle v leqslant d 1 we have W x l 0 j 1 v e j a c i j ℓ 1 v j a i ℓ x 1 displaystyle Omega x lambda 0 sum j 1 v e j alpha ci j prod ell in 1 cdots v setminus j left alpha i ell x 1 right Thanks to L displaystyle Lambda the Lagrange interpolation trick the sum degenerates to only one summand for x a i k displaystyle x alpha i k W a i k l 0 e k a c i k ℓ 1 v k a i ℓ a i k 1 displaystyle Omega left alpha i k right lambda 0 e k alpha c cdot i k prod ell in 1 cdots v setminus k left alpha i ell alpha i k 1 right To get e k displaystyle e k we just should get rid of the product We could compute the product directly from already computed roots a i j displaystyle alpha i j of L displaystyle Lambda but we could use simpler form As formal derivative L x l 0 j 1 v a i j ℓ 1 v j a i ℓ x 1 displaystyle Lambda x lambda 0 sum j 1 v alpha i j prod ell in 1 cdots v setminus j left alpha i ell x 1 right we get again only one summand in L a i k l 0 a i k ℓ 1 v k a i ℓ a i k 1 displaystyle Lambda left alpha i k right lambda 0 alpha i k prod ell in 1 cdots v setminus k left alpha i ell alpha i k 1 right So finally e k a i k W a i k a c i k L a i k displaystyle e k frac alpha i k Omega left alpha i k right alpha c cdot i k Lambda left alpha i k right This formula is advantageous when one computes the formal derivative of L displaystyle Lambda form L x i 1 v l i x i displaystyle Lambda x sum i 1 v lambda i x i yielding L x i 1 v i l i x i 1 displaystyle Lambda x sum i 1 v i cdot lambda i x i 1 where i x k 1 i x displaystyle i cdot x sum k 1 i x Decoding based on extended Euclidean algorithm Edit An alternate process of finding both the polynomial L and the error locator polynomial is based on Yasuo Sugiyama s adaptation of the Extended Euclidean algorithm 11 Correction of unreadable characters could be incorporated to the algorithm easily as well Let k 1 k k displaystyle k 1 k k be positions of unreadable characters One creates polynomial localising these positions G x i 1 k x a k i 1 displaystyle Gamma x prod i 1 k left x alpha k i 1 right Set values on unreadable positions to 0 and compute the syndromes As we have already defined for the Forney formula let S x i 0 d 2 s c i x i displaystyle S x sum i 0 d 2 s c i x i Let us run extended Euclidean algorithm for locating least common divisor of polynomials S x G x displaystyle S x Gamma x and x d 1 displaystyle x d 1 The goal is not to find the least common divisor but a polynomial r x displaystyle r x of degree at most d k 3 2 displaystyle lfloor d k 3 2 rfloor and polynomials a x b x displaystyle a x b x such that r x a x S x G x b x x d 1 displaystyle r x a x S x Gamma x b x x d 1 Low degree of r x displaystyle r x guarantees that a x displaystyle a x would satisfy extended by G displaystyle Gamma defining conditions for L displaystyle Lambda Defining 3 x a x G x displaystyle Xi x a x Gamma x and using 3 displaystyle Xi on the place of L x displaystyle Lambda x in the Fourney formula will give us error values The main advantage of the algorithm is that it meanwhile computes W x S x 3 x mod x d 1 r x displaystyle Omega x S x Xi x bmod x d 1 r x required in the Forney formula Explanation of the decoding process Edit 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 s i displaystyle s i restricts error word by condition s i j 0 n 1 e j a i j displaystyle s i sum j 0 n 1 e j alpha ij We could write these conditions separately or we could create polynomial S x i 0 d 2 s c i x i displaystyle S x sum i 0 d 2 s c i x i and compare coefficients near powers 0 displaystyle 0 to d 2 displaystyle d 2 S x 0 d 2 E x i 0 d 2 j 0 n 1 e j a i j a c j x i displaystyle S x stackrel 0 cdots d 2 E x sum i 0 d 2 sum j 0 n 1 e j alpha ij alpha cj x i Suppose there is unreadable letter on position k 1 displaystyle k 1 we could replace set of syndromes s c s c d 2 displaystyle s c cdots s c d 2 by set of syndromes t c t c d 3 displaystyle t c cdots t c d 3 defined by equation t i a k 1 s i s i 1 displaystyle t i alpha k 1 s i s i 1 Suppose for an error word all restrictions by original set s c s c d 2 displaystyle s c cdots s c d 2 of syndromes hold than t i a k 1 s i s i 1 a k 1 j 0 n 1 e j a i j j 0 n 1 e j a j a i j j 0 n 1 e j a k 1 a j a i j displaystyle t i alpha k 1 s i s i 1 alpha k 1 sum j 0 n 1 e j alpha ij sum j 0 n 1 e j alpha j alpha ij sum j 0 n 1 e j left alpha k 1 alpha j right alpha ij New set of syndromes restricts error vector f j e j a k 1 a j displaystyle f j e j left alpha k 1 alpha j right the same way the original set of syndromes restricted the error vector e j displaystyle e j Except the coordinate k 1 displaystyle k 1 where we have f k 1 0 displaystyle f k 1 0 an f j displaystyle f j is zero if e j 0 displaystyle e j 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 displaystyle k In polynomial formulation the replacement of syndromes set s c s c d 2 displaystyle s c cdots s c d 2 by syndromes set t c t c d 3 displaystyle t c cdots t c d 3 leads to T x i 0 d 3 t c i x i a k 1 i 0 d 3 s c i x i i 1 d 2 s c i x i 1 displaystyle T x sum i 0 d 3 t c i x i alpha k 1 sum i 0 d 3 s c i x i sum i 1 d 2 s c i x i 1 Therefore x T x 1 d 2 x a k 1 1 S x displaystyle xT x stackrel 1 cdots d 2 left x alpha k 1 1 right S x After replacement of S x displaystyle S x by S x G x displaystyle S x Gamma x one would require equation for coefficients near powers k d 2 displaystyle k cdots 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 displaystyle 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 L x displaystyle Lambda x denotes the polynomial eliminating the influence of these coordinates we obtain S x G x L x k v d 2 0 displaystyle S x Gamma x Lambda x stackrel k v cdots d 2 0 In Euclidean algorithm we try to correct at most 1 2 d 1 k displaystyle 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 L x displaystyle Lambda x we are looking for the equation must hold for coefficients near powers starting from k 1 2 d 1 k displaystyle k left lfloor frac 1 2 d 1 k right rfloor In Forney formula L x displaystyle Lambda x could be multiplied by a scalar giving the same result It could happen that the Euclidean algorithm finds L x displaystyle Lambda x of degree higher than 1 2 d 1 k displaystyle 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 L x displaystyle Lambda x of higher degree we decide not to correct the errors Correction could fail in the case L x displaystyle Lambda 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 Edit 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 Edit Decoding of binary code without unreadable characters Edit Consider a BCH code in GF 24 with d 7 displaystyle d 7 and g x x 10 x 8 x 5 x 4 x 2 x 1 displaystyle g x x 10 x 8 x 5 x 4 x 2 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 x 4 x 3 x 1 displaystyle M x x 4 x 3 x 1 The checksum symbols are calculated by dividing x 10 M x displaystyle x 10 M x by g x displaystyle g x and taking the remainder resulting in x 9 x 4 x 2 displaystyle x 9 x 4 x 2 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 0 0 1 1 1 0 0 0 1 1 0 1 0 0 In polynomial notation R x C x x 13 x 5 x 14 x 11 x 10 x 9 x 5 x 4 x 2 displaystyle R x C x x 13 x 5 x 14 x 11 x 10 x 9 x 5 x 4 x 2 In order to correct the errors first calculate the syndromes Taking a 0010 displaystyle alpha 0010 we have s 1 R a 1 1011 displaystyle s 1 R alpha 1 1011 s 2 1001 displaystyle s 2 1001 s 3 1011 displaystyle s 3 1011 s 4 1101 displaystyle s 4 1101 s 5 0001 displaystyle s 5 0001 and s 6 1001 displaystyle s 6 1001 Next apply the Peterson procedure by row reducing the following augmented matrix S 3 3 C 3 1 s 1 s 2 s 3 s 4 s 2 s 3 s 4 s 5 s 3 s 4 s 5 s 6 1011 1001 1011 1101 1001 1011 1101 0001 1011 1101 0001 1001 0001 0000 1000 0111 0000 0001 1011 0001 0000 0000 0000 0000 displaystyle left S 3 times 3 C 3 times 1 right begin bmatrix s 1 amp s 2 amp s 3 amp s 4 s 2 amp s 3 amp s 4 amp s 5 s 3 amp s 4 amp s 5 amp s 6 end bmatrix begin bmatrix 1011 amp 1001 amp 1011 amp 1101 1001 amp 1011 amp 1101 amp 0001 1011 amp 1101 amp 0001 amp 1001 end bmatrix Rightarrow begin bmatrix 0001 amp 0000 amp 1000 amp 0111 0000 amp 0001 amp 1011 amp 0001 0000 amp 0000 amp 0000 amp 0000 end bmatrix Due to the zero row S3 3 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 S2 2 C2 1 which gives rise to the solution l 2 1000 displaystyle lambda 2 1000 l 1 1011 displaystyle lambda 1 1011 The resulting error locator polynomial is L x 1000 x 2 1011 x 0001 displaystyle Lambda x 1000x 2 1011x 0001 which has zeros at 0100 a 13 displaystyle 0100 alpha 13 and 0111 a 5 displaystyle 0111 alpha 5 The exponents of a displaystyle alpha correspond to the error locations There is no need to calculate the error values in this example as the only possible value is 1 Decoding with unreadable characters Edit Suppose the same scenario but the received word has two unreadable characters 1 0 0 1 1 0 0 1 1 0 1 0 0 We replace the unreadable characters by zeros while creating the polynomial reflecting their positions G x a 8 x 1 a 11 x 1 displaystyle Gamma x left alpha 8 x 1 right left alpha 11 x 1 right We compute the syndromes s 1 a 7 s 2 a 1 s 3 a 4 s 4 a 2 s 5 a 5 displaystyle s 1 alpha 7 s 2 alpha 1 s 3 alpha 4 s 4 alpha 2 s 5 alpha 5 and s 6 a 7 displaystyle s 6 alpha 7 Using log notation which is independent on GF 24 isomorphisms For computation checking we can use the same representation for addition as was used in previous example Hexadecimal description of the powers of a displaystyle alpha are consecutively 1 2 4 8 3 6 C B 5 A 7 E F D 9 with the addition based on bitwise xor Let us make syndrome polynomial S x a 7 a 1 x a 4 x 2 a 2 x 3 a 5 x 4 a 7 x 5 displaystyle S x alpha 7 alpha 1 x alpha 4 x 2 alpha 2 x 3 alpha 5 x 4 alpha 7 x 5 compute S x G x a 7 a 4 x a 1 x 2 a 6 x 3 a 1 x 4 a 5 x 5 a 7 x 6 a 3 x 7 displaystyle S x Gamma x alpha 7 alpha 4 x alpha 1 x 2 alpha 6 x 3 alpha 1 x 4 alpha 5 x 5 alpha 7 x 6 alpha 3 x 7 Run the extended Euclidean algorithm S x G x x 6 a 7 a 4 x a 1 x 2 a 6 x 3 a 1 x 4 a 5 x 5 a 7 x 6 a 3 x 7 x 6 a 7 a 3 x 1 1 0 x 6 a 7 a 4 x a 1 x 2 a 6 x 3 a 1 x 4 a 5 x 5 2 a 7 x 6 2 a 3 x 7 a 7 a 3 x 1 1 0 a 4 a 5 x 1 1 0 a 7 a 4 x a 1 x 2 a 6 x 3 a 1 x 4 a 5 x 5 a 3 a 7 a 3 x, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.