I need to transform a parity-check matrix H
(that only consists of ones and zeros) from a non-standard to a standard form, this is, express it as:
Hsys = [A | I]
H
and Hsys
share the same dimension: (n-k,n)
. I
above corresponds to an identity matrix of dimension (n-k)
.
Gauss-Jordan elimination comes in handy to solve this problem. Matlab has an specific command, rref
, for this purpose, however it is no longer valid while working over GF(2) as in our case. Glancing through the Internet I found in Github a potentially suitable solution to overcome this drawback. However it does not always work out.
I also tried doing HH = mod(rref(H),2)
, which did not work at all, as many of the output elements weren't binary.
Here below you may find three samples of non-standard parity check matrices in which Gauss-Jordan elimination (over GF(2)) can be applied. As there should always be a way to arrange any matrix to be systematic, I would need a method that works out with matrices of any dimension.
These first sample is taken from sid's post in Stackoverflow, not responded yet:
H=[1 0 1 1 0;
0 0 1 0 1;
1 0 0 1 0;
1 0 1 1 1];
H=[1 1 0 1 1 0 0 1 0 0;
0 1 1 0 1 1 1 0 0 0;
0 0 0 1 0 0 0 1 1 1;
1 1 0 0 0 1 1 0 1 0;
0 0 1 0 0 1 0 1 0 1];
The last one is a matrix of dimension (50x100)
and can be found in this link to my Dropbox.
Edit on 21/06/2017
The solution proposed by @Jonas worked out in some cases, but not in most of them, as H matrix seems to be singular. Any other similar way to do this?
Thank you in advance, and best regards.