const_ldpccc_mat.m

来自「Low density parity check matrix」· M 代码 · 共 38 行

M
38
字号
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%A program written for generating LDPC matrix in as pattern as discussed in
%the research paper.
% Time varying periodic convolutional codes with low density parity check
% matrix byAlberto jim閚ez Felstr鰉 and Kamil Sh. zigangirov IEEE Transaction
% on information theory vol 45 no 6 sept 1999. pages 2181-2191
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Date 26th may 2009
% written by Engr_Zahoor Ahmed Baloch ENSIL France
% email add:  engr_shadanzai@yahoo.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [H]=const_ldpccc_mat(H);

%which construct a Convolutional LDPC matrix having memory M and periode T = M-1
clc;
M=3;
n=M+1;
B=zeros(2*n-1,2*n);
A=[1 0 1 0;0 1 1 0;0 1 0 1;1 0 0 1 ];

B(1,2:n+1)=A(1,:);
B(1:2,1)=[1;1];
B(1:2,2+n)=[0;1];
for i=2:n
    X(1,1:n)=[A(i,i:n),A(i,1:i-1)];
    B(2*i-1,i+1:i+n)=X(1,1:n);
    B(2*i-1:2*i,i)=[1;1];
    B(2*i-1:2*i,i+n+1)=[0;1];
end;
% now duplicate the matrix as many time as there are no of processors
Nb_proc=1;
[H_L,H_C]=size(B);
H=zeros(H_L*Nb_proc,n+(n)*Nb_proc-1);
for i=1:Nb_proc,
    H((i-1)*H_L+1:i*H_L,(i-1)*n+1:H_C+n*(i-1))=B;
end;
H;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?