How to obtain a systematic generator matrix from a large sparse parity check matrix for LDPC Codes?

23 次查看(过去 30 天)
How to obtain a systematic generator matrix from a large sparse parity check matrix for LDPC Codes? I cannot use "par2gen"as it require systematic parity check matrix, which is very difficult to obtain for a sparse H matrix of LDPC codes......
  1 个评论
Shawn
Shawn 2023-3-3
I know it's 8 years since you asked this question, but I had the same problem and solved it (at least well enough for my needs). The code below bascially takes an LDPC encoder object, extracts its parity check matrix, puts it the standard parity check form using a piece of code I found on GitHub, then forms the gnenerator matrix. As you mentioned, most LDPC parity check matrices aren't in standard form, but you should be able to reverse the linear algebra operations to get you back to same parity check matrix and then perform the same operations to get the corresponding generator matrix. But you're right, it seems a real oversight that MathWorks doesn't just give you the generator matrix as well. Anyway, here is the code:
%Generate H and G froom LDPC code object
function [reshapedH, G] = GenerateHandGfromLDPC(cfgLDPCEnc)
pcmatrix = cfgLDPCEnc.ParityCheckMatrix; %Get the parity check matrix from the Encoder object
parity = full(pcmatrix); %Expand the matrix to full size
H = g2rref(parity); %Do a rref on the binary matrix. Code for this function here: https://github.com/nnininnine/MATLAB/blob/master/g2rref.m
meat = H(:,[(cfgLDPCEnc.NumParityCheckBits+1):end]); %Get the non-identity matrix "meat" of the parity check matrix
reshapedH = [meat eye(cfgLDPCEnc.NumParityCheckBits)]; %Reformat the parity check matrix to be in a standard form of [meat identityMatrix].
G = [eye(cfgLDPCEnc.NumInformationBits) transpose(meat)]; %The generator is now [indentityMatrix meat']
test = mod(reshapedH*transpose(G),2); %Test to see if we formed it correctly; test should be an all-0 matrix in GF(2) (i.e. binary)
sum(test(:)); %Quick test of our test - this should be zero because all the elements of the test matrix should be zero
end

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Error Detection and Correction 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by