How would I take a generator polynomial and construct a generator matrix out of it for a cyclic code?
For example, I have a cyclic code in:
$R_{15}=GF(2)[x] / \langle x^{15} + 1\rangle$
This is given by the generator polynomial:
$g(x) = x^8 + x^4 + x^2 + x + 1$
So, the length is 15 and the dimension is 15 - 8 = 7. How would I go about constructing a generator matrix from that?
Should be a k x n matrix which is 7 x 15 correct?
$G = \begin{bmatrix} 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 & 0 & 1 \end{bmatrix}$
That is what I come up with, just wondering if this is the correct way to do it?
This is correct. The rows of $G$ correspond to the generator polynomial (expressed as a binary $n-$tuple) with all its (non cyclical) $k$ shifts, which correspond to the "canonical" input messages $u_0=(1,0,0,0 \cdots) \equiv 1$, $u_1=(0,1,0,0 \cdots) \equiv x $, $u_2=(0,0,1,0 \cdots) \equiv x^2 $, and so on.
This is the generator for the standard (non-systematic) cyclic code. If you instead want to build a systematic cyclic code, that's a different story.