BCH code
Encyclopedia : B : BC : BCH : BCH code
A BCH (Bose, Ray-Chaudhuri, Hocquenghem) code is a much studied code within the study of coding theory and more specifically error-correcting codes. In technical terms a BCH code is a multilevel, cyclic, error-correcting, variable-length digital code used to correct multiple random error patterns. BCH codes may also be used with multilevel phase-shift keying whenever the number of levels is a prime number or a power of a prime number. A BCH code in 11 levels has been used to represent the 10 decimal digits plus a sign digit.
Construction
BCH codes use field theory and polynomials over finite fields. To detect errors a check polynomial can be constructed so the receiving end can detect if some errors had occurred.The BCH code with designed distance δ over the field GF(qm) is constructed by first finding a polynomial over GF(q) whose roots include δ consecutive powers of γ, some root of unity.
To construct a BCH code that can detect and correct up to two errors, we use the finite field GF(16) or Z2[x]/<x4 + x + 1>. Now if α is a root of m1(x) = x4 + x + 1, then m1 is minimal for α since
- m1(x) = (x - α)(x - α2)(x - α4)(x - α8)=x4 + x + 1.
- C(x) ≡ 0 (mod m1(x))
This does not allow us to choose many codewords - so we look for the minimal polynomial for the missing power of α from above - α3, and then the minimal polynomial for this is
- m3(x) = x4 + x3 + x2 + x + 1.
We take codewords having all of these as roots, so we form the polynomial
- m1,3(x) = m1(x)m3(x) = x8 + x7 + x6 + x4+1
- C(x) ≡ 0 (mod m1,3(x))
Now in GF(16) we have 15 nonzero elements, and thus our polynomial will be of degree 14 with 8 check and 7 information bits - we have 8 check bits since we have (*).
Encoding
Construct our information codeword as- (c14, c13, ..., c8)
- c14+c13+...+c8
We then want to find a CR such that CR=CI (mod m1,3(x))=c7+c6+...+c0
So we have the following codeword to send C(x) = CI+CR (mod m1,3(x)) = 0
For example, if we are to encode (1,1,0,0,1,1,0)
- CI=x14+x13+x10+x9
- x3+1
- (1,1,0,0,1,1,0, 0,0,0,0,1,0,0,1)
Decoding
BCH decoding is split into the following 4 steps- Calculate the 2t syndrome values, for the received vector R
- Calculate the error locator polynomials
- Calculate the roots of this polynomial, to get error location positions.
- If non-binary BCH, Calculate the error values at these error locations.
The following steps are illustrated below. Suppose we receive a codeword vector r (the polynomial R(x)).
If there is no error R(α)=R(α3)=0
If there is one error, ie r=c+ei where ei represents the ith basis vector for R14
So then
- S1=R(α)=C(α)+αi=αi
- S3=R(α3)=C(α3)+(α3)i
- : =(αi)3=S13
If there are two errors
- r=c+ei+ej
- S1=R(α)=C(α)+αi+αj
- S3=R(α3)=C(α3)+(α3)i+(α3)j
- : = (α3)i+(α3)j
Original source (first two paragraphs) from Federal Standard 1037C
The above text has been taken from: http://bch-code.foosquare.com/
BCH Decoding algorithms
Popular decoding algorithms are,- Peterson Gorenstein Zierler algorithm
- Berlekamp-Massey algorithm
Peterson Gorenstein Zierler Algorithm
Assumptions
Peterson's algorithm, is the step 2, of the generalized BCH decoding procedure. We use Peterson's algorithm, to calculate the error locator polynomial coefficients [ \lambda_1 , \lambda_2 ... \lambda_ ] of a polynomial[ \Lambda(x) = 1 + \lambda_1 X + \lambda_2 X^2 + ... + \lambda_X^ ]Now the procedure of the Peterson Gorenstein Zierler algorithm, for a given [(n,k,d_) ] BCH code designed to correct [[t=frac-1}]] errors, is
Algorithm
- First generate the Matrix of [2t] syndromes,
- Next generate the [S_] matrix with the elements, Syndrome values,
- Generate a [c_] matrix with, elements,
- Let [\Lambda] denote the unknown polynomial coefficients, which are given,using,
- Form the matrix equation
- If the determinant of matrix [S_] exists, then we can actually, find an inverse of this matrix, and solve for the values of unknown [\Lambda] values.
- If [ det(S_) = 0 ], then follow
if [t = 0] then declare an empty error locator polynomial stop Peterson procedure. end set [ t \leftarrow t -1] continue from the beginning of Peterson's decoding
Factoring Error Locator polynomial
Now that you have [\Lambda(x)] polynomial, you can find its roots in the form [\Lambda(x)=(\alpha^i X + 1) (\alpha ^j X + 1) ... (\alpha^k X + 1)] using, the Chiens search algorithm. The exponential powers of the primitive element [\alpha], will yield the positions where errors occur in the received word; hence the name 'error locator' polynomial.Correcting Errors
For the case of binary BCH, you can directly correct the received vectors, at the positions of the powers of primitive elements, of the error locator polynomial factors. Finally, just flip the bits for the received word, at these positions, and we have the corrected code word, from BCH decoding.We may also use Berlekamp-Massey algorithm for determining the error locator polynomial, and hence solve the BCH decoding problem.
References
- S. Lin and D. Costello. Error Control Coding: Fundamentals and Applications. Prentice-Hall, Englewood Cliffs, NJ, 2004.
- [Step by step decoding instructions] (pdf file).
- Federal Standard 1037c: http://federal-standard-1037c.foosquare.com/
- Galois Field Calculator: http://www.geocities.com/myopic_stargazer/gf_calc.zip
- Decoding Algorithms for BCH codes: http://students.uta.edu/mx/mxa6471/research/ecc-report.pdf
- Source code for BCH channel simulation: http://students.uta.edu/mx/mxa6471/research/ecc-code.tgz
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
