Borrar filtros
Borrar filtros

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

24 visualizaciones (últimos 30 días)
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 comentario
Shawn
Shawn el 3 de Mzo. de 2023
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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Error Detection and Correction en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by