Using MATLAB and C MEX
This LDPC software is intended as an introduction to LDPC codes computer based simulation. The pseudorandom irregular low density parity check matrix is based on Radford M. Neal’s programs collection, which can be found in [1]. While Neal’s collection is well documented, in my opinion, C source codes are still overwhelming, especially if you are not knowledgeable in C language. My software is written for MATLAB, which is more readable than C. You may also want to refer to another MATLAB based LDPC source codes in [2], which has different flavor of codewriting style (in fact Arun has error in his loglikelihood decoder).
Creating LDPC matrix
Steps for creating LDPC matrix (from Neal's website):
 Select one of the method for creating sparse parity check matrix: (1) Evencol, or (2) Evenboth.
 Add 1s to rows that have no 1s or only have one 1 in them.
 If desired, try to avoid having cycle of lenghtfour, where pair of column, both have 1s in particular rows
Evencol randomly distribute the same amount of 1s between columns, evenboth is similar to evencol, but also try to make rows having the same number of 1s.
Function makeLdpc.m accepts 5 parameters:
 M: Number of row
 N: Number of column
 method: Method for distributing 1s, 0 = Evencol, 1 = Evenboth
 noCyle: Eliminate lengthfour cycle
 onePerCol: Number of 1s per column.
The output is M x N matrix parity check matrix H. This function can only create R = 1/2 LDPC matrix.
Generating parity check bits
Parity check bits is computed using sparse LU decomposition, utilizing sparse matrix properties of H. Let H = [AB]. We need to decompose A become LU, where L is lower triangular and U is upper triangular. In order the reduction to work, A must be nonsingular, hence A must be reordered to give 1s on the diagonal. Steps for reordering A are (simplification from Neal's website):
 Set L and U to all zeros.
 Set F to H
for i = 1 to M:
 Find nonzero element of F that is in row i and column i, or in the latter column
 Rearrange columns of F and H from i onward to put this element in row i column i
 Copy column i of F up to row i to column i of U
 Copy column i of F from row i to colunm i of L
 Add row i of F to later rows that have value 1 in column i.
end
 Set B to the N  M column of the rearranged H.
There are 3 strategies to choose the next nonzero element for the diagonal:
 First: choose the first found nonzero element from column i onward from column search.
 Mincol (minimal column): choose nonzero element from column i onward that has minimum number of nonzeros in its column.
 Minprod (minimal product): choose nonzero element from column i onward that minimized the product of: (1) the number of nonzeros in its row minus 1, and (2) the number of nonzeros in its column minus 1.
Let z = Bs, where s is binary input vector. Solve L(Uc) = z for c, where c is parity check vector. Provided c is correct, let u = [cs]. We should have Hu' = 0, where H is rearranged original H.
Function makeParityChk.m accepts 3 parameters:
 dSource: Binary source
 H: Parity check matrix (from makeLdpc.m)
 strategy: Strategy for LU decomposition, 0 = First, 1 = Mincol, and 2 = Minprod,
and the output will be:
 c: Parity check bits vector
 newH: Rearrange H, which should be used for encodingdecoding instead of original H.
Decoding
LDPC code decoding is done using iterative belief propagation or sumproduct algorithm (SPA). Four versions of SPA decoder (BPSK modulated under AWGN channel) are presented:
 Harddecision (bitflip) decoder (decodeBitFlip.m)
Decode 0/1 message, choose '1' if the majority is 1, else '0'. The decoder could be used for tutorial or introduction to message passing algorithms since it does not employ complicated probability or loglikelihood function. Expect worse performance compared to BPSK for very low Eb/N0.
 Probabilitydomain SPA decoder (decodeProbDomain.m)
Based on Gallager's works [3].
 Logdomain SPA decoder (decodeLogDomain.m)
Similar to probabilitydomain SPA, but using loglikelihood instead of probability function. The advantage is operations can be done using additions instead of multiplications, which computationaly less expensive.
 Simplified logdomain SPA decoder (decodeLogDomainSimple.m)
A modified version of logdomain SPA, replaces Pi(x) with minimum(x). For further simplification, loglikelihood function can be replaced with incoming signal waveform directly [5], hence simplified logdomain decoder does not need noise variance information.
Both probabilitydomain and logdomain decoder need noise variance (N0/2) information for their input. Other decoder's paramaters include received noisy signal, H matrix and number of iteration.
Putting it all together
Download all the files below and run ldpcBer.m, you'll be good! You might want to modify ldpcBer.m first, running smaller size of LDPC matrix (i.e. smaller data frame) or chose your prefered decoder.
CMEX decoder
You need to compile decodeLogDomainSimpleMex.c, and replace any of the LDPC decoder with the new compiled MEX file. It was tested well using Matlab C compiler (under Microsoft Windows XP and Vista) and Microsoft Visual C++ version 6.0.

Run LDPC codes BER simulation.
Create a R = 1/2 LDPC matrix.
Create parity check bits.
Harddecision SPA decoder
Probabilitydomain SPA decoder.
Logdomain SPA decoder.
Simplified logdomain SPA decoder.
CMEX of simplified logdomain SPA decoder. 
Upadates
 18 February 2008: Eb/N0 value correction.
 11 March 2009: CMEX source code for LDPC decoder added.
 8 January 2013: Result plot added.
Reference (Drop me an email if you need any of these materials)
[1] Radford M. Neal, http://www.cs.toronto.edu/~radford/ftp/LDPC20060208/
[2] Arun Avudainayagam, http://arun10.tripod.com/ldpc/ldpc.htm
[3] R. G. Gallager, LowDensity ParityCheck Codes. Cambridge, MA: M. I. T. Press, 1963.
[4] D. MacKay, "Good error correcting codes based on very sparse matrices," IEEE Trans. Information Theory, pp. 399431, March 1999.
[5] W. E. Ryan, "An introduction to LDPC codes," August 2003.
[6] Bernhard M. J. Leiner, "LDPC codes  a Brief Tutorial," April 2005.