I am trying to make a parity check matrix from non-systematic to systematic.
3 次查看(过去 30 天)
显示 更早的评论
I am trying to make a parity check matrix from non-systematic to systematic. Hence, I am attaching my code below. Somewhat it is correct, but there are some problems. It would be really great if someone could help me in this. Subject: Information theory and coding. I am working on LDPC coding and decoding. Please check the code below
MATLAB CODE
H=[1 0 1 1 0; 0 0 1 0 1; 1 0 0 1 0; 1 0 1 1 1]
[m,n]=size(H);
k=n-m;
for i=k+1:n
%H(:,i)
ind=find(H(:,i),1,'last');
% exchanging (ind)th row and (i-k)th row
if ind<i-k
continue;
end
if ind~=i-k
temp=H(ind,:);
H(ind,:)=H(i-k,:);
H(i-k,:)=temp;
end
I=find(H(:,i));
% Guassian elimination
for j=1:length(I)
if I(j)~=i-k
H(I(j),:)=mod(H(I(j),:)+H(i-k,:),2);
end
end
end
Hsys=H
For e.g.
This is my H matrix
H =
1 0 1 1 0
0 0 1 0 1
1 0 0 1 0
1 0 1 1 1
I want to have an identity matrix inside the matrix. the dimension on H matrix here is (mxn) which is (4x5).
I should have matrix as this in the result:
Hsys =
0 1 0 0 0
0 0 1 0 0
1 0 0 1 0
0 0 0 0 1
enter image description here
I should have an identity matrix of dimension 'm'
0 个评论
回答(1 个)
busra tegin
2018-6-12
Maybe I'm so late in answering, but your code works well with full rank parity check matrices (I did not check the code line by line, there may be still some mistakes). In your example, H is not full rank (its rank is 3), so you cannot obtain an idendity matrix of 4 by 4 with Gaussian elimination.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 AI for Wireless 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!