m LDPC bit error rate matlab simulation based on SPA sum-product decoding algorithm

Table of contents

1. Algorithm simulation effect

2. Algorithms involve an overview of theoretical knowledge

3. MATLAB core program

4. Complete algorithm code file


1. Algorithm simulation effect

The matlab2022a simulation results are as follows:

2. Algorithms involve an overview of theoretical knowledge

       LDPC (Low-density Parity-check, low-density parity-check) code is a class of linear block codes (linear block codes) with a sparse parity check matrix proposed by Gallager in 1963, but in the next 30 years due to calculation Insufficient ability, it has been ignored by people. In 1996, D MacKay, M Neal and others re-studied it and found that LDPC codes have excellent performance approaching Shannon's limit. And it has the characteristics of low decoding complexity, parallel decoding and detectable decoding errors, etc., so it has become a new research hotspot in channel coding theory.

        The non-regular LDPC code proposed by Mckay and Luby generalizes the concept of LDPC code. The performance of non-regular LDPC codes is not only better than that of regular LDPC codes, but even better than that of Turbo codes. It is the code closest to the Shannon limit known so far.

       In the check matrix of LDPC codes, if the row and column weights are fixed as (P, Y), that is, each check node has Y variable nodes participating in the check, and each variable node participates in P check nodes, we call it Regular LDPC code. The Gallager code originally proposed by Gallager has this property. From the point of view of coding bipartite graph, the degree of variable nodes of this LDPC code is all P, and the degree of check nodes is all Y. We can also appropriately relax the above-mentioned conditions of the regular LDPC code, the average value of the row and column weights may not be an integer, but the row and column weights should obey the uniform distribution as much as possible. In addition, in order to ensure that there is no cycle with a length of 4 on the bipartite graph of the LDPC code. We usually require that the weight of the overlap between rows and columns and between columns should not exceed 1. The so-called overlap is the same part of any two columns or two rows. We can summarize the characteristics of the check matrix H of the regular LDPC code as follows:

1. The weight of each row of H is fixed to P, and the weight of each column is fixed to Y.

2. The number of columns (rows) with the same 1 between any two rows (columns) (called the number of overlaps) does not exceed 1, that is, there is no small square matrix with four corners of 1 in the H matrix, that is, there is no 4-line cycle.

3. The row weight P and column weight Y are relatively small compared to the row number M and column number N of H, and H is a sparse matrix.

        In the parity check matrix of regular LDPC codes. The average value of the row weight and column weight remains unchanged, so the number of 1s in the check matrix increases linearly with the increase of the code length, and the number of elements in the entire check matrix grows quadratically. When the code length reaches a certain length, the parity check matrix H is a very sparse low-density matrix. For regular LDPC codes, MacKay gave the following two conclusions:

1. For any LDPC code with a given column weight greater than 3, there is a rate r that is less than the channel transmission capacity and greater than zero. When the code length is long enough, error-free transmission at a rate less than r and not zero can be achieved . That is to say, for any given non-zero transmission rate r, there is a noise threshold smaller than the corresponding Shannon limit. When the channel noise is lower than this threshold and the code length is long enough, error-free transmission at rate r can be realized.

2. When the column weight Y of the parity check matrix H of the LDPC code is not fixed, but is determined according to the channel characteristics and transmission rate, an optimal code can be found to achieve no error at any rate smaller than the channel transmission capacity transmission.

       The definitions of LDPC codes are all based on binary domains, and MaKcay has promoted the LDPC codes in the above binary domains. If the domain in the definition is not limited to the binary domain, the LDPC codes on the multivariate domain GF(q) can be obtained. LDPC codes on multivariate domains have better performance than binary LDPC codes, and practice shows that the LDPC codes constructed on larger domains have better decoding performance. For example, the performance of regular codes constructed on GF(16) has been The warp is almost the same as the Turbo code. The reason why the multi-field LDPC code has such excellent performance is that it has a heavier column weight than the binary field LDPC code, and also has a bipartite graph structure similar to the binary field LDPC code.


The code rate is 0.5, the code length is 2304, nb=24, kb=12,

The fundamental matrix is

In this part, an H matrix is ​​generated for decoding.

correspond

correspond

correspond

correspond

3. MATLAB core program

........................................................

H       = func_H(Hb,eye(96));
[Rh,Ch] = size(H);
x        = [ones(1,Ch)];
EbN0     = [0:0.5:2];


Max_iter = 1;


for ij = 1:length(EbN0)
    for k = 1:100
    [k,ij]
    sigma = sqrt(1/(10^(EbN0(ij)/10)));
    %实际验证过程中,这个位置加入你的编码模块
    code  = (2*x-1);
    r     = code+randn(size(x))*sigma;
    %对应PPT公式
    Lv    = 2*r/(sigma^2);
    %SPA算法
    [ber,v1] = Sum_product_algorithm(Lv,H,Max_iter);
    %输入变量
    x(Rh+1:Ch);
    %输出变量
    v1(Rh+1:Ch);
    %计算错误数据
    err1(k,ij)=1-length(find(v1(Rh+1:Ch)==x(Rh+1:Ch)))/length(x(Rh+1:Ch));
    end
end

if Max_iter==1
   save R1.mat EbN0 err1
end
if Max_iter==5
   save R2.mat EbN0 err1
end
if Max_iter==10
   save R3.mat EbN0 err1
end
if Max_iter==25
   save R4.mat EbN0 err1
end
if Max_iter==100
   save R5.mat EbN0 err1
end


figure;
semilogy(EbN0,mean(err1,1),'b-o');
grid on
xlabel('EBNO');
ylabel('ber');
14_040_m

4. Complete algorithm code file

V

Guess you like

Origin blog.csdn.net/hlayumi1234567/article/details/129642907