BCH code: Difference between revisions

Content deleted Content added
Link suggestions feature: 3 links added.
Tags: Visual edit Mobile edit Mobile web edit Newcomer task Suggested: add links
 
(24 intermediate revisions by 18 users not shown)
Line 1:
{{short description|Error correction code}}
In [[coding theory]], the '''BCH codes''' or '''Bose&ndash;Chaudhuri&ndash;Hocquenghem codes''' ('''BCH codes''') form a class of [[cyclic code|cyclic]] [[Error correction code|error-correcting codes]] that are constructed using [[polynomial]]s over a [[finite field]] (also called a ''[[Finite field|Galois field]]''). BCH codes were invented in 1959 by French mathematician [[Alexis Hocquenghem]], and independently in 1960 by [[Raj Chandra Bose|Raj Bose]] and [[D.K. Ray-Chaudhuri|D. K. Ray-Chaudhuri]].<ref>{{Harvnb|Reed|Chen|1999|p=189}}</ref><ref>{{harvnb|Hocquenghem|1959}}</ref><ref>{{harvnb|Bose|Ray-Chaudhuri|1960}}</ref> The name ''Bose&ndash;Chaudhuri&ndash;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 [[Abstract algebra|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,<ref>{{cite web|title=Phobos Lander Coding System: Software and Analysis|url=http://ipnpr.jpl.nasa.gov/progress_report/42-94/94V.PDF |archive-url=https://ghostarchive.org/archive/20221009/http://ipnpr.jpl.nasa.gov/progress_report/42-94/94V.PDF |archive-date=2022-10-09 |url-status=live|access-date=25 February 2012}}</ref> [[compact disc]] players, [[DVD]]s, [[Disk storage|disk drives]], [[USB flash drive]]s, [[solid-state drive]]s,<ref>{{cite webbook|titlechapter=SandforceBCH SFCodes for Solid-2500State-Drives|doi=10.1007/2600978-981-13-0599-3_11 Product Brief|chapter-url=httphttps://wwwlink.sandforcespringer.com/indexchapter/10.php?id1007/978-981-13-0599-3_11|access-date=133&parentId23 September 2023 |title=2&topInside Solid State Drives (SSDS) |series=1Springer Series in Advanced Microelectronics |access-date=252018 February|last1=Marelli 2012}}</ref>|first1=Alessia [[Post-quantum|last2=Micheloni cryptography|quantum-resistantfirst2=Rino cryptography]]<ref>http://pqc|volume=37 |pages=369–406 |isbn=978-hqc.org/doc/hqc981-specification_202013-050598-29.pdf6 }}</ref> and [[Bar codesBarcode|two-dimensional bar codes]].
 
== Definition and illustration ==
Line 10 ⟶ 11:
Given a [[prime number]] {{mvar|q}} and [[prime power]] {{math|''q''<sup>''m''</sup>}} with positive integers {{mvar|m}} and {{mvar|d}} such that {{math|''d'' ≤ ''q''<sup>''m''</sup> − 1}}, a primitive narrow-sense BCH code over the [[finite field]] (or Galois field) {{math|GF(''q'')}} with code length {{math|''n'' {{=}} ''q''<sup>''m''</sup> − 1}} and [[Block code#The distance d|distance]] at least {{mvar|d}} is constructed by the following method.
 
Let {{mvar|α}} be a [[Simple_extensionSimple extension#Definition|primitive element]] of {{math|GF(''q''<sup>''m''</sup>)}}.
For any positive integer {{mvar|i}}, let {{math|''m''<sub>''i''</sub>(''x'')}} be the [[minimal polynomial (field theory)|minimal polynomial]] with coefficients in {{math|GF(''q'')}} of {{math|α<sup>''i''</sup>}}.
The [[generator polynomial]] of the BCH code is defined as the [[least common multiple]] {{math|''g''(''x'') {{=}} lcm(''m''<sub>1</sub>(''x''),…,''m''<sub>''d'' − 1</sub>(''x''))}}.
It can be seen that {{math|''g''(''x'')}} is a polynomial with coefficients in {{math|GF(''q'')}} and divides {{math|''x''<sup>''n''</sup> − 1}}.
Therefore, the [[polynomial code]] defined by {{math|''g''(''x'')}} is a cyclic code.
 
==== Example ====
Let {{math|''q'' {{=}} 2}} and {{math|''m'' {{=}} 4}} (therefore {{math|''n'' {{=}} 15}}). We will consider different values of {{mvar|d}}. Forfor {{math|GF(16) {{=}} GF(2<sup>4</sup>)}} based on the reducing polynomial {{math|''xz''<sup>4</sup> + ''xz'' + 1}}, withusing primitive rootelement {{math|''α''(''z'') {{=}} ''xz''}}. thereThere are fourteen minimum polynomials {{math|''m''<sub>''i''</sub>(''x'')}} with coefficients in {{math|GF(2)}} satisfying
:<math>m_i\left(\alpha^i\right) \bmod \left(xz^4 + xz + 1\right) = 0.</math>
 
The minimal polynomials of the fourteen powers of {{math|α}} are
:<math>\begin{align}
m_1(x) &= m_2(x) = m_4(x) = m_8(x) = x^4 + x + 1, \\
Line 28 ⟶ 29:
\end{align}</math>
 
The BCH code with <math>d = 2, 3</math> has the generator polynomial
:<math>g(x) = {\rm lcm}(m_1(x), m_2(x)) = m_1(x) = x^4 + x + 1.\,</math>
 
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 <math>d=4,5</math> has the generator polynomial
:<math>\begin{align}
g(x) &= {\rm lcm}(m_1(x),m_2(x),m_3(x),m_4(x)) = m_1(x) m_3(x) \\
Line 39 ⟶ 40:
\end{align}</math>
 
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 <math>d=6,7</math> has the generator polynomial
:<math>\begin{align}
g(x) &= {\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) \\
Line 47 ⟶ 48:
\end{align}</math>
 
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 patternsinformation" of the [[QR code]].)
 
The BCH code with <math>d=8</math> and higher has the generator polynomial
:<math>\begin{align}
g(x) &= {\rm lcm}(m_1(x),m_2(x),...,m_{14}(x)) = m_1(x) m_3(x) m_5(x) m_7(x)\\
Line 55 ⟶ 56:
\end{align}</math>
 
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 ===
Line 78 ⟶ 79:
The generator polynomial <math>g(x)</math> of a BCH code has coefficients from <math>\mathrm{GF}(q).</math>
In general, a cyclic code over <math>\mathrm{GF}(q^p)</math> with <math>g(x)</math> as the generator polynomial is called a BCH code over <math>\mathrm{GF}(q^p).</math>
The BCH code over <math>\mathrm{GF}(q^m)</math> and generator polynomial <math>g(x)</math> with successive powers of <math>\alpha</math> 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 <math>\mathrm{GF}(q^m)</math> .<ref>{{Harvnb|Gill|n.d.|p=3}}</ref> The other type of Reed Solomon code is an [[Reed%E2%80%93Solomon_error_correctionReed–Solomon error correction#Reed_Reed &_Solomon Solomon's_original_views original view:_The_codeword_as_a_sequence_of_values |The codeword as a sequence of values|original view Reed Solomon code]] which is not a BCH code.
 
== Properties ==
 
The generator polynomial of a BCH code has degree at most <math>(d-1)m</math>. Moreover, if <math>q=2</math> and <math>c=1</math>, the generator polynomial has degree at most <math>dm/2</math>.
{{Collapse top|title=Proof}}
Line 134:
 
=== 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.
 
Line 152 ⟶ 151:
 
=== 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 <math>s(x)</math> is divisible by <math>g(x)</math>.
 
Line 201 ⟶ 199:
 
The first step is finding, compatible with computed syndromes and with minimal possible <math>t,</math> locator polynomial:
:<math>\Lambda(x) = \prod_{j=1}^t \left(x\alpha^{i_j} - 1\right)</math>
 
TwoThree popular algorithms for this task are:
# [[#Peterson–Gorenstein–Zierler algorithm|Peterson–Gorenstein–Zierler algorithm]]
# [[Berlekamp–Massey algorithm]]
# [[Reed–Solomon error correction#Euclidean decoder|Sugiyama Euclidean algorithm]]
 
====Peterson–Gorenstein–Zierler algorithm====
<!-- this confuses t (max number of errors that can be corrected) with ν (actual number of errors) -->
[[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 <math> \lambda_1 , \lambda_2, \dots, \lambda_{v} </math> of a polynomial
 
: <math> \Lambda(x) = 1 + \lambda_1 x + \lambda_2 x^2 + \cdots + \lambda_v x^v .</math>
Line 408 ⟶ 407:
:<math>R(x) = C(x) + x^{13} + x^5 = x^{14} + x^{11} + x^{10} + x^9 + x^5 + x^4 + x^2</math>
In order to correct the errors, first calculate the syndromes. Taking <math>\alpha = 0010,</math> we have <math>s_1 = R(\alpha^1) = 1011,</math> <math>s_2 = 1001,</math> <math>s_3 = 1011,</math> <math>s_4 = 1101,</math> <math>s_5 = 0001,</math> and <math>s_6 = 1001.</math>
Next, apply the Peterson procedure by row-reducing the following [[augmented matrix]].
:<math>\left [ S_{3 \times 3} | C_{3 \times 1} \right ] =
\begin{bmatrix}s_1&s_2&s_3&s_4\\
Line 427 ⟶ 426:
 
==== Decoding with unreadable characters ====
Suppose the same scenario, but the received word has two unreadable characters [ 1 {{color|red|0}} 0 ? 1 1 ? 0 0 {{color|red|1}} 1 0 1 0 0 ]. We replace the unreadable characters by zeros while creating the polynomial reflecting their positions <math>\Gamma(x) = \left(\alpha^8x - 1\right)\left(\alpha^{11}x - 1\right).</math> We compute the syndromes <math>s_1=\alpha^{-7}, s_2=\alpha^{1}, s_3=\alpha^{4}, s_4=\alpha^{2}, s_5=\alpha^{5},</math> and <math>s_6=\alpha^{-7}.</math> (Using log notation which is independent on GF(2<sup>4</sup>) isomorphisms. For computation checking we can use the same representation for addition as was used in previous example. [[Hexadecimal]] description of the powers of <math>\alpha</math> 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
Line 619 ⟶ 618:
}}
* {{Citation
|firstfirst1= R. C.
|lastlast1= Bose
|author-link= R. C. Bose
|first2= D. K.
Line 632 ⟶ 631:
|date= March 1960
|issn= 0890-5401
|doi=10.1016/s0019-9958(60)90287-4|url= http://repository.lib.ncsu.edu/bitstream/1840.4/2137/1/ISMS_1959_240.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://repository.lib.ncsu.edu/bitstream/1840.4/2137/1/ISMS_1959_240.pdf |archive-date=2022-10-09 |url-status=live
}}
 
===Secondary sources===
* {{Citation|last=Gill |first=John |title=EE387 Notes #7, Handout #28 |date=n.d. |access-date=April 21, 2010 |pages=42–45 |publisher=Stanford University |url=http://www.stanford.edu/class/ee387/handouts/notes7.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://www.stanford.edu/class/ee387/handouts/notes7.pdf |archive-date=2022-10-09 |url-status=live }}{{dead link|date=June 2021|bot=medic}}{{cbignore|bot=medic}} Course notes are apparently being redone for 2012: http://www.stanford.edu/class/ee387/ {{Webarchive|url=https://web.archive.org/web/20130605170343/http://www.stanford.edu/class/ee387/ |date=2013-06-05 }}
* {{Citation
|lastlast1= Gorenstein
|firstfirst1= Daniel
|author-link= Daniel Gorenstein
|last2= Peterson
Line 656 ⟶ 655:
}}
* {{Citation
|firstfirst1= Rudolf
|lastlast1= Lidl
|first2= Günter
|last2= Pilz
Line 666 ⟶ 665:
}}
* {{Citation
|firstfirst1= Irving S.
|lastlast1= Reed
|author-link= Irving S. Reed
|first2= Xuemin
Line 681 ⟶ 680:
* {{Citation |last1=Blahut |first1=Richard E. |author-link1=Richard Blahut |title=Algebraic Codes for Data Transmission |edition=2nd |publisher=[[Cambridge University Press]] |year=2003 |isbn=0-521-55374-1}}
* {{Citation
|firstfirst1= W. J.
|lastlast1= Gilbert
|first2= W. K.
|last2= Nicholson
Line 691 ⟶ 690:
}}
* {{Citation
|firstfirst1= S.
|lastlast1= Lin
|first2= D.
|last2= Costello
Line 701 ⟶ 700:
}}
* {{Citation
|firstfirst1= F. J.
|lastlast1=MacWilliams
|first2= N. J. A.
|last2= Sloane
Line 717 ⟶ 716:
|publisher = University at Buffalo
|url = http://www.cse.buffalo.edu/~atri/courses/coding-theory/
|archive-url = https://web.archive.org/web/2010070212065020121218004156/http://www.cse.buffalo.edu:80/~atri/courses/coding-theory/
|access-date = April 21, 2010
|archive-date = 20102012-0712-0218
|archive-url = https://web.archive.org/web/20100702120650/http://www.cse.buffalo.edu/~atri/courses/coding-theory/
|archive-date = 2010-07-02
|url-status = dead
}}