Definition. A code is cyclic if it is closed under cyclic shift: \[ (c_1, c_2, \ldots, c_{n-1}, c_n) \in C \Rightarrow (c_n, c_1, c_2, \ldots, c_{n-1}) \in C \]
Definition. A cyclic linear code (i.e., a cyclic code) of length \(n\) is a subset of \(\mathbb{Z}_2[x]/(x^n+1)\) that is closed under addition and closed under multiplication by \(x\). (A cyclic code is an ideal of \(\mathbb{Z}_2[x]/(x^n+1)\).)
Over \(\mathbb{Z}_2\), \(x^7+1 = (x+1)(x^3+x+1)(x^3+x^2+1)\).
\(p(x)\) | \([n,k]\) | Code |
---|---|---|
\(x+1\) | \([7,6]\) | parity check |
\(x^3 + x + 1\) or \(x^3 + x^2 + 1\) | \([7,4]\) | Hamming |
\((x+1)(x^3 + x + 1)\) or \((x+1)(x^3 + x^2 + 1)\) | \([7,3]\) | Hamming dual |
\((x^3 + x + 1)(x^3 + x^2 + 1) = x^6+x^5+x^4+x^3+x^2+x+1\) | \([7,1]\) | repetition |
\(\mbox{GF}(2^n)\) is a field containing \(\mathbb{Z}_2\) and an element \(\alpha\), such that \(p(\alpha) = 0\). We say that \(\mbox{GF}(2^n)\) is an extension field of \(\mathbb{Z}_2\).
Example: \(\mbox{GF(4)} = \mathbb{Z}_2[x]/(x^2+x+1)\)
Over \(\mathbb{Z}_2\), let \(\alpha\) be a root of \(x^3 + x + 1\). Compute all the powers of \(\alpha\), simplifying when possible. How many are there?
Over \(\mathbb{Z}_2\), let \(\alpha\) be a root of \(x^3 + x^2 + x + 1\). Compute all the powers of \(\alpha\), simplifying when possible. How many are there?
Facts: \(\mbox{GF}(2^n)\) contains an element \(\alpha\) such that:
Examples: \(\mbox{GF(4)}\), \(\mbox{GF(8)}\)
i1 : R = ZZ/2[x]
o1 = R
o1 : PolynomialRing
i2 : factor(x^7+1)
3 3 2
o2 = (x + 1)(x + x + 1)(x + x + 1)
o2 : Expression of class Product
i1 : R = GF(8)[x]
o1 = R
o1 : PolynomialRing
i2 : factor(x^7+1)
2 2 2 2
o2 = (x + 1)(x + a)(x + a )(x + a + 1)(x + a + a)(x + a + a + 1)(x + a + 1)
o2 : Expression of class Product
i1 : F = GF(8)
o1 = F
o1 : GaloisField
i2 : ambient F
ZZ
--[a]
2
o2 = ----------
3
a + a + 1
o2 : QuotientRing
i3 : apply(1..7, i -> a^i)
2 2 2 2
o3 = (a, a , a + 1, a + a, a + a + 1, a + 1, 1)
o3 : Sequence
Fact: Let \(\alpha\) be a primitive \(n\)th root of unity in some extension field of \(\mathbb{Z}_2\). Then
\[x^n + 1 = (x+1)(x+\alpha)(x+\alpha^2)\cdots(x+\alpha^{n-1})\]
So a divisor \(g(x)\) of \(x^n+1\) (and therefore a cyclic code \(\langle g(x) \rangle\)) determines a set of powers of \(\alpha\) that are zeroes of \(g(x)\).
Let \(C=\langle g(x)\rangle\) be a cyclic code in \(\mathbb{Z}_2[x]/(x^{13}+1)\), and let \(\alpha\) be a primitive \(13\)th root of unity. Suppose that \(g(\alpha^4) = g(\alpha^5) = 0\).
Let \(p(x)\) be the parity check polynomial such that \(g(x)p(x) = x^{13} + 1\). Use the fact that \(x^{13}+1\) splits over \(\mathbb{Z}_2(\alpha)\) to explain why \(p(\alpha^4) \neq 0 \neq p(\alpha^5)\).
Suppose that, for some \(k\), the polynomial \(m(x) = x^k\) is a code word of weight 1. Show that this leads to a contradiction.
Suppose that, for some \(j,k\), the polynomial \(m(x) = x^j+ x^k\) is a code word of weight 2. Show that this leads to a contradiction.
Explain why the minimum distance of \(C\) is at least 3.
Theorem. Let \(C = \langle g(x) \rangle\) be a cyclic code in \(\mathbb{Z}_2[x]/(x^n+1)\), for \(n\) odd. Let \(\alpha\) be a primitive \(n\)th root of unity, and suppose that for some integers \(l\) and \(\delta\), \[g(\alpha^l) = g(\alpha^{l+1}) = \cdots = g(\alpha^{l+\delta})=0.\] Then the minimum distance of \(C\) is at least \(\delta + 2\).
Let \(\alpha\) be a primitive \(n\)th root of unity.
Macaulay2 tells us that over \(\mathbb{Z}_2\),
\[x^7+1 = (x+1)(x^3+x^2+1)(x^3+x+1)\]
Furthermore, over \(\text{GF}(8)\),
\[ \begin{align} x^3+x^2+1 &= (x + \alpha^3)(x+\alpha^5)(x+\alpha^6) \\ x^3+x+1 &= (x+\alpha)(x+\alpha^2)(x+\alpha^4) \end{align} \]
Exercise. In \(\mathbb{Z}_2[x]/(x^7+1)\),
Let \(\langle g(x) \rangle\) be a BCH code in \(\mathbb{Z}_2[x]/(x^n+1)\) of designed distance \(d \geq 3\), so \(g(\alpha^l) = g(\alpha^{l+1})=0\) for some \(l\) and for a primitive \(n\)th root of unity \(\alpha\).
Let \(r(x) = m(x) + e(x)\), where \(m(x)\) is a code word and \(e(x)\) is an error vector.
Let \(\langle g(x) \rangle\) be a BCH code in \(\mathbb{Z}_2[x]/(x^n+1)\) of designed distance \(d \geq 3\), so \(g(\alpha^l) = g(\alpha^{l+1})=0\) for some \(l\) and for a primitive \(n\)th root of unity \(\alpha\). Let \(r(x) = m(x) + e(x)\), where \(m(x)\) is a code word and \(e(x)\) is an error vector.
\[\begin{align} s &= r(\alpha^l) \\ &= m(\alpha^l) + e(\alpha^l) \\ &= 0 + e(\alpha^l) && \mbox{ since } m(x) \in \langle g(x) \rangle \end{align}\]
Suppose there is one error, so \(e(x) = x^k\) for some \(k\).
\[\begin{align} s^{-1}r(\alpha^{l+1}) &= (e(\alpha^l))^{-1}e(\alpha^{l+1}) && \mbox{ by part 1} \\ &= ((\alpha^l)^k)^{-1}(\alpha^{l+1})^k \\ &= \alpha^k && \mbox{ properties of exponents} \end{align}\]
The Mars Global Surveyor (MGS) was launched in 1996 and retired in 2007. According to this journal article by a JPL scientist,
The MGS downlink to Earth incorporates a 25 W travelling wave tube amplifier and a gimballed, 1:5 m high-gain antenna with a transmit gain of 39:1 dBic. Forward error correction coding options include a \((255, 223)\) Reed-Solomon code concatenated with either a \((7, \frac{1}{2})\) or \((15, \frac{1}{6})\) convolutional code.
Recall,
Theorem. Let \(C = \langle g(x) \rangle\) be a cyclic code in \(\mathbb{Z}_2[x]/(x^n+1)\), for \(n\) odd. Let \(\alpha\) be a primitive \(n\)th root of unity, and suppose that for some integers \(l\) and \(\delta\), \[g(\alpha^l) = g(\alpha^{l+1}) = \cdots = g(\alpha^{l+\delta})=0.\] Then the minimum distance of \(C\) is at least \(\delta + 2\).
The BCH Bound Theorem generalizes to other finite fields.
Theorem. Let \(C = \langle g(x) \rangle\) be a cyclic code in \(F[x]/(x^n-1)\), where \(F\) has \(q=p^m\) elements. Assume \(p \nmid n\). Let \(\alpha\) be a primitive \(n\)th root of unity, and suppose that for some integers \(l\) and \(\delta\), \[g(\alpha^l) = g(\alpha^{l+1}) = \cdots = g(\alpha^{l+\delta})=0.\] Then the minimum distance of \(C\) is at least \(\delta + 2\).
Fact: Suppose \(F\) is finite field with \(q\) elements. If \(n = q-1\), then \(F\) contains a primitive \(n\)th root of unity \(\alpha\).
So we can construct a code in \(F[x]/(x^n-1)\) using a generating polynomial of the following form.
\[ g(x) = (x-\alpha)(x-\alpha^2)\cdots(x-\alpha^{d-1}) \]
and then the theorem tells us the minimum distance of \(\langle g(x) \rangle\) is at least \(d\).
Such \(\langle g(x) \rangle\) is called a Reed-Solomon code.
Consider \(F = \mathbb{Z}_7\). A Reed-Solomon code is an ideal of \(\mathbb{Z}_7[x]/(x^6-1)\).
We need a primitive 6th root of unity in \(\mathbb{Z}_7\).
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1 1 1 1 1 1
[2,] 2 4 1 2 4 1
[3,] 3 2 6 4 5 1
[4,] 4 2 1 4 2 1
[5,] 5 4 6 2 3 1
[6,] 6 1 6 1 6 1
Consider \(F = \mathbb{Z}_7\). A Reed-Solomon code is an ideal of \(\mathbb{Z}_7[x]/(x^6-1)\).
Let \(\alpha = 3\) be our primitive 6th root of unity in \(\mathbb{Z}_7\).
A distance 4 code is generated by \(g(x) = (x-3)(x-3^2)(x-3^3) = x^3+3x^2+x+6\).
The dimension of this code is \(k = n - \deg(g(x)) = 6-3 = 3\). Therefore a generating matrix is:
\[ G = \begin{bmatrix} 6 & 1 & 3 & 1 & 0 & 0 \\ 0 & 6 & 1 & 3 & 1 & 0 \\ 0 & 0 & 6 & 1 & 3 & 1 \end{bmatrix} \]
The number of code words is \(7^3 = 343\).
Exercise. Let \(g(x) = x^2 + \alpha^4x + \alpha^3\) be the generator for a Reed-Solomon code in \(\text{GF}(8)[x]/(x^7+1)\).
Let \(\langle g(x) \rangle\) be a Reed-Solomon code in \(F[x]/(x^n-1)\) of distance \(d \geq 3\), so \(g(\alpha) = g(\alpha^{2})=0\) for a primitive \(n\)th root of unity \(\alpha\), where \(n+1\) is the size of \(F\).
Let \(r(x) = m(x) + e(x)\), where \(m(x)\) is a code word and \(e(x)\) is an error vector.
For the code \(\langle x^2 + \alpha^4x + \alpha^3 \rangle\) in \(\text{GF}(8)[x]/(x^7+1)\), decode the received word \[ r(x) = x^6 + \alpha^3x^4 + \alpha^2x^3 + \alpha^4x^2 + \alpha^6 x + \alpha^6 \]
i1 : R = GF(8)[x]
o1 = R
o1 : PolynomialRing
i2 : r = x^6 + a^3*x^4 + a^2*x^3 + a^4*x^2 + a^6*x + a^6
6 4 2 3 2 2 2 2
o2 = x + (a + 1)x + a x + (a + a)x + (a + 1)x + a + 1
o2 : R
i3 : s = sub(r, x=>a)
o3 = a
o3 : GF 8
So \(s = \alpha\). Continuing, we get \(s^{-1} r(\alpha^{2}) = \alpha^3\), so the error is in the \(x^3\) term. The error vector is \(e(x) = s\alpha^{-3}x^3 = \alpha^{-2}x^3 = \alpha^5x^3\). The decoded word is \(r(x)+e(x) = x^6 + \alpha^3x^4 + \alpha^3x^3 + \alpha^4x^2 + \alpha^6 x + \alpha^6\).
Recall that the elements of \(\text{GF}(2^m)\) can be regarded as bit strings. For example,
i1 : F = GF(8)
o1 = F
o1 : GaloisField
i3 : apply(1..7, i -> a^i)
2 2 2 2
o3 = (a, a , a + 1, a + a, a + a + 1, a + 1, 1)
o3 : Sequence
We can identify these with 010, 001, 110, 011, 111, 101, 100, and along with 000 we get all the 3-digit bit strings.
The MGS used a \((255, 233)\) Reed-Solomon code.