BCH code (source code)

= BCH code
{c}
{wiki}

Let $\mathbb F_q$ be a <finite field>, let $n$ be coprime to $q$, and choose an element $\alpha$ of <multiplicative order> $n$ in an <field extension>. A <BCH code> of length $n$, starting exponent $b$, and design distance $2\le\delta\le n$ is the <cyclic code> whose <generator polynomial of a cyclic code> is
$$
g(X)=\operatorname{lcm}\bigl(m_b(X),m_{b+1}(X),\ldots,m_{b+\delta-2}(X)\bigr),
$$
where $m_i$ is the <algebraic minimal polynomial> of $\alpha^i$ over $\mathbb F_q$. Equivalently, $g$ is the least-degree <monic polynomial> over the base <finite field> vanishing at $\delta-1$ consecutive powers. This least-degree condition distinguishes the <BCH code> from its proper <cyclic code> subcodes with additional zeros. The <BCH bound> gives <minimum Hamming distance> at least $\delta$.

For example, over the <field with two elements>, let $n=7$ and let $\alpha$ be a <polynomial root> of $X^3+X+1$. The roots $\alpha$ and $\alpha^2$ have the same <algebraic minimal polynomial>, so $b=1$ and $\delta=3$ give $g=X^3+X+1$, a <Hamming code of length seven>.<Shift-Register Synthesis and BCH Decoding by James L. Massey>[Sections IV–V: BCH codes and synthesis-based decoding]{ref}