How to get the P matrices of a linear code?

152 Views Asked by At

I have a question attendend to linear codes matrices and the creating of it. The generator matrices is defined as:

G=$\array{[I_n | P]}$

and the check matrices is defined as:

H=$\array{[-P^T | I_n-_k]}$

When I get the code $\array{[n,k,d]}$ as $\array{[6,3,2]}$ with the words $\array{[000,011,101,110]}$

How I can create the generator matrices G=$\array{[I_n | P]}$?

What I've done

The $I_n$ part are just the unit vectors I=$\begin{bmatrix}1 & 0 & 0 \\0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}$

and I think that the P matrices is just the base of the vector room from the code words $\array{[000,011,101,110]}$

So that I can use the gauss algorithm to get the result (base) like:

P=$\begin{bmatrix}1 & 1 & 0 \\0 & 1 & 1 \\ 0 & 0 & 0\end{bmatrix}$

at the end I can congatenate the matrices I and P to the G matrices

P=$\begin{bmatrix}1 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 0 & 0 & 0\end{bmatrix}$

Is the way like I create the P matrices correct? Does exist a way to get the code words when just the G or H matrices is given (something like reverse engineering)?

Thanks for your support!

1

There are 1 best solutions below

0
On

Recall that if you have a message space $M$ and a generator matrix $G=[I_kP]$, you can produce a code word $c$ such that $mG=c$, where $m \in M$. I would assume that your field is binary. To construct a generator matrix $G$, which has $k$-linearly independent rows, you know that there your code should contain $2^k=2^3= 8$ codewords and 3 of the codewords of length $n=6$ should generate the whole codewords. Since you want the distance of the code to be $2$ (at least 2 is just fine), then these three codewords should generate all the codewords that you want namely: $$\alpha= (11000000),\quad \beta= (001100), \quad \gamma= (000011).$$ Note that your linear code C should contain $$\{\alpha, \beta, \gamma, \alpha+\beta, \alpha+\gamma, \beta +\gamma, (000000), \alpha+\beta+\gamma\}.$$ Thus your generator matrix should be something like this $$G= \begin{bmatrix} 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ \end{bmatrix}$$ which you can put in the standard form if you like. I guess thats the idea behind it. Lest I forget your words have length $3$ and should be $6$. I guess what you were given is the message space and not the actual code. And if thats the case $mG$ should produce a codeword in $C$.