资源分类:Matlab 工具:MATLAB 7 (R14)

LDPC ( Low-density Parity-check,低密度奇偶校验)码

低密度奇偶校验码图(LDPC码)本质上是一种线形分组码,它通过一个生成矩阵G将信息序列映射成发送序列,也就是码字序列。对于生成矩阵G,完全等效地存在一个奇偶校验矩阵H,所有的码字序列C构成了H的零空间  (null space),即HCT=0。

DLPC 码的奇偶校验矩阵H是一个稀疏矩阵,相对于行与列的长度,校验矩阵每行、列中非零元素的数目(我们习惯称作行重、列重)非常小,这也是LDPC码之所以称为低密度码的原因。由于校验矩阵H的稀疏性以及构造时所使用的不同规则,使得不同LDPC码的编码二分图(Tanner图)具有不同的闭合环路分布。而二分图中闭合环路是影响LDPC码性能的重要因素,它使得LDPC码在类似可信度传播(Belief ProPagation)算法的一类迭代译码算法下,表现出完全不同的译码性能。


LDPC Code Simulation

The zip file contains

1. A 128x256 Regular (3,6) H matrix (if you need to simulate other codes, need to write your own code for generating those parity check matrices). The file '128x256regular_v6.mat' is for those using Matlab 6.5.

2. Files for LDPC code simulation over the AWGN channel.

3. Matlab-based and C-based (C-mex file)implementation of the LDPC decoder. The main simulation script contains the commands for the use of both decoders (there are 2 C-based decoders and one Matlab based). The commands for the decoder that are going to be used need to "uncommented", and those for the other decoder need to be "commented".

3a. To compile the C-mex file, need to install a C compiler (I have used Miscosoft Visual C++ 6.0). Then have to go to the Matlab command window and do

">>mex -setup" (then go through the steps of selecting the desired compiler).

Then do:

">>mex decode_ldpc.cpp" (or ">>mex decode_ldpc_new.cpp"). This will produce a "dll" file by the name of "decode_ldpc.dll" (or "decode_ldpc_new.dll"), and this can then be used by the main script for simulation. I am including already compiled "dll" files which work with Maltab 7.0 (and Matlab 6.5). However if the included "dll" files do not work for you then you have to compile the "*.cpp" files using the method explained above.

3b. The Matlab code uses "Sparse" implementation for the various matrices, and is therefore makes efficient use of memory (this makes some difference if you -like me- use a standard PC for simulation and are using large H matrices that have block length greater than 3000). However if memory and CPU power and not your limitations then the C-based decoder is much faster.

4. The bit errors are counted over the entire code word. The main script needs to be modified for counting bit errors if a systematic matrix is being used.

5. The modulation used is BPSK.


To run a simulation

1. Open the script file by the name of


2. Load a H (parity-check) matrix

3. Set the SNR range

4. Set maximum number of decoder iteration, and maximum number of errored codewords to count for each SNR point (must be at least 30 for reliable estimate, the papers show results for 100-200 codeword errors. OUCH!!!).

5. Select the C-based OR Matlab-based LDPC decoder.

5A. The decoder "decode_ldpc_new" is much faster than "decode_ldpc" (the difference in speed increases with block length).

6. Run the script and wait for the results :) .

LDPC.zip (81.36KB)  
bpsk.m  decode_ldpc.cpp  decode_ldpc_matlab.m  decode_ldpc_new.cpp  generic_simulator_nonsys.m  one_finder.m  
标签: LDPC 


用户反馈   关于我们
Copyright (©) ZHIHUISHI.COM 2013 All Rights Reserved.