But What if My parity matrix is not of form [-P' In-k] or [In-k -P' ]. What if sub matrix which is an Identity matrix of order n-k doesn't exist?
How do I generate generator Matrix from such Parity check matrix using MATLAB.
This is particularly a concern because LDPC Parity check matrix is huge. So need Matlab help.
Is there a way to convert my Parity check Matrix [H] in [-P' In-k] or [In-k -P' ] this form in MATLAB?
hi.u can use this function:
if G=[I D] that I is a identity matrix:
Code:
function [b]=inv_GF2(A)
%Ainv=inv_GF2(A)
dim=size(A);
rows=dim(1);
cols=dim(2);
for i=1:rows
for j=1:rows
unity(i,j)=0;
end
unity(i,i)=1;
end
for i=1:rows
b(1:rows,i)=gflineq(A,unity(1:rows,i));
end
H=[h1 h2];
[m,n]=size(H);
A(1:m,1:m)=H(1:m,1:m);
B(1:m,1:m)=H(1:m,m+1:n);
d=mod(inv_GF2(B)*A,2);
I=eye(m);
G=[ I d'];