Generating LDPC codes of arbitrary sizes in MATLAB

I am having problems generating LDPC codes of arbitrary sizes in MATLAB primarily because MATLAB insists on the parity check matrix that is input into its ldpcenc function has the sub-matrix that encompasses the last $n-k$ columns being invertible. The error that is thrown by the ldpcenc function when an unsuitable matrix is input is:

The last (N-K) columns of the parity-check matrix must be invertible in GF(2)


I am generating parity matrices with the online tool found HERE which accepts the maximum node degrees and the code rate as input and outputs optimised parity check matrices for BEC and AWGN channels. An obvious solution to this problem would seem to just convert my parity check matrices to standard systematic form - I tried doing this by using THIS function from Matworks file exchange but the resulting parity check matrix (even though it gets accepted just fine by the ldpcenc function) doesn't seem to 'work' (i.e a code with rate = 1/2 and block size 20 can't correct the received code even if there is just 1 bit in error).

How can I generate LDPC codes of arbitrary sizes in MATLAB? Any help appreciated.

• Hey did u find the answer to your question? – ujjwala Oct 18 '16 at 3:47