基于5G通信系统的LDPC编译码误码率

目录

一、理论基础

二、核心程序

三、仿真结论


一、理论基础

       基于5G通信系统的LDPC(Low-Density Parity-Check)编译码误码率研究涉及到通信系统的信道编码和译码技术,主要用于提高系统的可靠性和传输效率。5G通信系统是第五代移动通信系统,旨在提供更高的数据速率、更低的延迟和更好的用户体验。它采用了新的无线技术和编码方案来满足大规模数据传输和连接数的需求。在5G系统中,LDPC编码是一种重要的信道编码技术,用于实现高效的纠错性能。
       LDPC编码是一种基于图论的线性块编码技术,通过构建稀疏校验矩阵来实现高效的编码和译码。LDPC码的编码过程是将输入数据与校验矩阵进行矩阵乘法运算得到编码后的输出数据。而LDPC码的译码过程是通过迭代解码算法来纠正传输中产生的错误。
        LDPC码的编码公式可以表示为:

      LDPC码的译码过程可以采用迭代译码算法,其中最常用的是消息传递算法(Sum-Product算法)。假设$\mathbf{r}$为接收到的信号向量,$\mathbf{L}$为初始的似然信息向量。在每次迭代中,通过更新LLR(Log-Likelihood Ratio)信息来逐步纠正错误比特。迭代计算的公式为: 

        其中,$i$和$j$分别表示校验节点和变量节点的索引,$N(i)$表示与校验节点$i$相连的变量节点集合,$\tanh^{-1}$表示反双曲正切函数。
       在5G通信系统中,对于采用LDPC编译码的信道,我们可以通过仿真或理论分析来评估其误码率性能。误码率(BER,Bit Error Rate)是衡量信号传输质量的重要指标,通常用来评估编码器和解码器的性能。
针对LDPC编译码,误码率性能与信噪比(SNR,Signal-to-Noise Ratio)之间的关系可以通过BER曲线来表示。通过不同的SNR值,计算解码输出与原始数据之间的比特错误率,得到BER曲线。

       此外,还可以通过解析方法推导LDPC码的误码率性能。一种常用的方法是利用信道容量近似法,通过计算信道容量来估计误码率性能。基于5G通信系统的LDPC编译码误码率研究是5G通信系统中关键的技术领域之一。本文介绍了LDPC编码在5G系统中的应用原理和数学公式,以及误码率性能的分析方法。通过对LDPC编码的研究,可以优化信号传输效率,提高通信系统的可靠性,满足5G通信系统对高速率、低延迟和大连接数的需求。

二、核心程序

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

EbNodB = [0:1:5];


for ij = 1:length(EbNodB)
for k = 1:20
[ij,k]
MaxItrs = 8;
rate_matching = 0;

load base_matrices\NR_1_0_16.txt;
B = NR_1_0_16;
[mb, nb] = size(B);
z = 16;

Slen = sum(B(:)~=-1);   %number of non '-1' in B
treg = zeros(max(sum(B~=-1,2)),z); %register storage for minsum

k = (nb - mb)*z;
n = nb*z;
if rate_matching == 1
    n = n -2*z;
end
Rate = k/n;                     
EbNo = 10^(EbNodB(ij)/10);              
sigma = sqrt(1/(2*Rate*EbNo));


Nbiterrs = 0; Nblkerrs = 0; Nblocks = 100;

for i = 1 : Nblocks
   %msg = randi([0 1],1,k);           %generate random message
   msg = zeros(1,k); % all-zero msg 
   
   %Encoding here
   cword = zeros(1,n);
      
   s = 1 - (2 * cword);                 %BPSK symbols
   r = s + sigma * randn(1,n);          %AWGN Channel
 
   %puncturing
   if rate_matching == 1
   r(1:2*z) = 0;
   end
   
   %Soft-Decision, iterative message-passing layered decoding here
   L = r;   % Total Belief
   itr = 0; % iteration number
   R = zeros(Slen, z);     %storage for row processing
   while itr < MaxItrs
       Ri = 0;
        for lyr = 1:mb
            ti = 0; % number of non -1 in row = lyr
            for col = 1:nb
                if B(lyr,col) ~= -1
                    ti = ti + 1;
                    Ri = Ri + 1;
                    %Substraction
                    L((col-1)*z+1:col*z) = L((col-1)*z+1:col*z) - R(Ri,:);
                    %Row alignment and store in treg
                    treg(ti,:) = mul_sh(L((col-1)*z+1:col*z),B(lyr,col));
                end  
            end
            %minsum on treg: ti x z
            for i1 = 1:z %treg(1:ti,i1)
                [min1, pos] = min(abs(treg(:,i1))); %first min
                min2 = min(abs(treg([1:pos-1 pos+1:ti],i1))); %second min
                S = sign(treg(1:ti,i1));
                parity = prod(S);
                treg(1:ti,i1) = min1; %absolute value for all
                treg(pos,i1) = min2; %absolute value for min1 position
                treg(1:ti,i1) = parity * S.*treg(1:ti,i1); %assign signs
            end
            %column alignment, addition and store in R
            Ri = Ri - ti; %reset the storage counter
            ti = 0;
            for col = 1:nb
                if B(lyr,col) ~= -1
                    Ri= Ri + 1;
                    ti = ti + 1;
                    %Column alignment
                    R(Ri,:) = mul_sh(treg(ti,:), z-B(lyr,col));
                    %Addition
                    L((col-1)*z+1:col*z) = L((col-1)*z+1:col*z) + R(Ri,:);
                end
            end
        end
        msg_cap = L(1:k) < 0; %decision
        itr = itr + 1;
   end

   Nerrs = sum(msg ~= msg_cap);
   
   if(Nerrs > 0)
      Nbiterrs = Nbiterrs + Nerrs;
      Nblkerrs = Nblkerrs + 1;
   end
end

BER_sim(ij,k) = Nbiterrs/(k*Nblocks);
FER_sim(ij,k) = Nblkerrs/Nblocks;

end
end


figure;
semilogy(EbNodB,mean(BER_sim,2),'b-o');
grid on
xlabel('EbNo');
ylabel('error');
up2175

三、仿真结论

猜你喜欢

转载自blog.csdn.net/ccsss22/article/details/131901271
今日推荐