BCH Code — Definition, Formula & Example
A BCH code is a type of error-correcting code where you first choose how many bit errors the code must fix. You then build its generator polynomial from roots in a finite field that guarantee that level of protection.
Let be a prime power, let , and let be a primitive th root of unity in . For a designed distance and an integer , the BCH code is the cyclic code of length over whose generator polynomial is the least common multiple of the minimal polynomials over of . The BCH bound guarantees a minimum distance . The code is narrow-sense when and primitive when .
Key Formula
Where:
- = Generator polynomial; every codeword is a multiple of it
- = Minimal polynomial of over
- = Number of errors the code is designed to correct
- = Block length, for a primitive binary BCH code
- = Number of message bits,
- = Degree of the field extension
Worked Example
Problem: Build the binary BCH code of length that corrects errors. Use with a primitive element satisfying , so . Find the generator polynomial and the message length .
Step 1: Correcting 2 errors requires the consecutive roots . Over , squaring a root gives another root of the same minimal polynomial. So you group the exponents by repeatedly doubling them mod 15.
Step 2: The roots , , and all share . Only needs a new polynomial. It has order , so it is a root of . It is not a root of , because .
Step 3: Multiply the two minimal polynomials using arithmetic mod 2, where . The degree of is the number of check bits.
Answer: The generator polynomial is . It defines a BCH code. The BCH bound gives . The codeword itself has weight 5, so exactly, and the code corrects any 2 errors in a 15-bit block.
Why It Matters
BCH codes protect the format information in every QR code, using a binary BCH code. Satellite TV under the DVB-S2 standard pairs a BCH outer code with an LDPC inner code. Flash-memory controllers in SSDs use BCH decoders to fix bit errors in stored data. In a college course on coding theory or abstract algebra, BCH codes are usually your first look at finite fields applied to a real engineering problem.
Common Mistakes
Mistake: Multiplying all minimal polynomials , which counts repeats such as .
Correction: Take the least common multiple, so each distinct minimal polynomial appears once. In the example, a plain product would have degree 16. That exceeds and leaves no room for message bits.
