File Exchange

image thumbnail

LDPC codes BER simulation

version 1.1 (8.5 KB) by

LDPC codes BER simulation under AWGN channel, MacKay-Neal based LDPC matrix

19 Ratings



View License

LDPC codes BER simulation under AWGN channel. MacKay-Neal based LDPC matrix. Message encoding uses sparse LU decomposition. There are 4 choices of decoder: hard-decision/bit-flip decoder, probability-domain SPA decoder, log-domain SPA decoder, and simplified log-domain SPA decoder. Documentation and update can be found at:

Comments and Ratings (33)

z m

z m (view profile)

i want to use this simulator for codes with rate not equal to 1/2. please explain why this works only for rate-1/2 codes, and how i can modify it for different rates such as 1/5,1/3,1/4, 2/3 and so on ?


imc (view profile)

Goutham C.S

Hey everyone, I tried running this MATLAB file but I dont get the plot after running ldpcBER.m . All i get is a blank plot. Please kindly help

Aimal Rehman

This is only for LDPC code with rate 1/2 ?

sumit skr

I tried the bitflipping decoding method. However, it does not work.

Sindhu B

i want to use this simulator for codes with rate not equal to 1/2. please explain why this works only for rate-1/2 codes, and how i can modify it for my project


HIT (view profile)


wang (view profile)



Ahmed (view profile)

well done work

Kevin King

good work


Zhe (view profile)

very helpful in the understanding of log domain sum product algorithm


If I want to use igenerated matrix H by makeLdpc with comm.LDPCEncoder object,what must I do. It poster a n error message 'The las comumn (n-k) must be invertible in GF(2)

alpa patel

nice one


Elnaz (view profile)

Is there any way to make the code run faster for generating large parity check matrices?
For generating a 32000 by 64000 matrix, this code will run forever!

i am not getting the good error performance,i am using block length of 1024 and i am varying snr from 0 to 4,but error performance is bad and i am getting different performance for each time for same values of input,can any one please suggest some solution for me,time is too less for my project submission

Kevin King

nice perfect

fas wer


Sun (view profile)

thanks,very useful

venn lee

thank you for the posting and sharing, i just read and understand the coding part,and i don't know the theory of decoding.

Sir can i know the algorithm used to create the H matrix in makeLdpc.please reply its urgent for our project.thanks in advance



liu nan


zhao long

very good , see the proceed is dark box, the same of the source bit and the received bit is the only standard .

Yuhan Zhou

Please check your codec, basically the parity check matrix is not correct, which means that H*u' is not zero vector.


Thank you for the programs .
But there some problems concerning the algorithm decodeLogDomainSimple: and specially in the calcul of the prior-likelihood (simplified).
Lci=-rx' ??
according to the algorithms
Lci= 4*rx/N0.
and about the sign -
Minus sign is used for 0/1 to -1/1.
I think that to get -1/1 mapping : Lci=2rx-1 .

Your Noise Calculation have some problem. The code rate is 0.5. You noise addition with signal is ok. But when you are transferring N0 to decodeLogDomain.m function that has to be N0*2.


simple and clear, very excellent

Sabah Sewan

God Bless You. thnx

michael jordan

simply perfect

nguyen khoa

Rethnakaran Pulikkoonattu

You may have to cross check the performance and benchmark it. If I am not mistaken, there is conflict in the results.

Yang Xiao

The BER results your program for short length of LDPC codes are not reliable, unbelievable, please check your program with other's published one.



Updated website address

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today