低密度奇偶校验码LDPC(七)——SPA和积译码算法的简化

 往期博文

低密度奇偶校验码LDPC(一)——概述_什么是gallager构造-CSDN博客

低密度奇偶校验码LDPC(二)——LDPC编码方法-CSDN博客

低密度奇偶校验码LDPC(三)——QC-LDPC码概述-CSDN博客

低密度奇偶校验码LDPC(四)——双对角线结构的QC-LDPC编码-CSDN博客

低密度奇偶校验码LDPC(五)——译码算法概述-CSDN博客

低密度奇偶校验码LDPC(六)——SPA和积译码算法-CSDN博客

QC-LDPC的FPGA实现

基于QC-LDPC编码的循环移位网络的FPGA实现_5g ldpc编码 桶形移位寄存器-CSDN博客

一、SPA译码算法的实际应用

查找表与拟合

 盒加SPA译码器

二、SPA译码算法的简化算法

最小和算法(MSA)

 归一化最小和算法(Normalized MSA, NMSA)

偏移最小和算法(Offset MSA, OMSA) 

 常见软判决译码算法对比

若对译码算法感兴趣,请参见文献[4] .

三、NMSA算法的Matlab实现

function [x_hat, iter_this_time] = Layered_NMSA_BP_decoder(llr, H_row_one_absolute_index, H_comlumn_one_relative_index, N, M, vn_degree, cn_degree, max_iter,alfa)
VN_array = zeros(max(vn_degree), N);
CN_tanh_tmp = zeros(max(cn_degree), 1);%CN temporary memory.
iter_this_time = max_iter;
for t = 1 : max_iter
    for c = 1 : M
        product = 1;
        for c_neighbor = 1 : cn_degree(c)%read data from VNs, and then store in CNs memory.
            Lji = sum(VN_array(:, H_row_one_absolute_index(c, c_neighbor))) + llr(H_row_one_absolute_index(c, c_neighbor)) - VN_array(H_comlumn_one_relative_index(c, c_neighbor), H_row_one_absolute_index(c, c_neighbor));%VN update. However, this simple MATLAB sentence consumes a lot of time.
            %CN_tanh_tmp(c_neighbor) = 1 - 2/(1 + exp(Lji));%Exact decoding. Equivalent to tanh(x/2), usually faster.
            if Lji==0
                Lji=1e-15;
            end
            CN_tanh_tmp(c_neighbor) =Lji;
            product = product * sign(Lji);%Avoid repeated calculations.
        end
        for c_neighbor = 1 : cn_degree(c)
            Lij = product/sign(CN_tanh_tmp(c_neighbor));%Extract Extrinsic information, i.e., divide itself.
            minsort=sort(abs(CN_tanh_tmp(1:cn_degree(c))));
            if abs(CN_tanh_tmp(c_neighbor))==minsort(1)
                VN_array(H_comlumn_one_relative_index(c, c_neighbor), H_row_one_absolute_index(c, c_neighbor)) = alfa*Lij*max(minsort(2),1e-15);
            else
                VN_array(H_comlumn_one_relative_index(c, c_neighbor), H_row_one_absolute_index(c, c_neighbor)) = alfa*Lij*max(minsort(1),1e-15);
            end
        end
    end
    
    x_hat = (sum(VN_array)' + llr) < 0;%Belief propagation Decision.
    parity_check = zeros(M, 1);
    for m = 1 : M
        for k = 1 : 1 : cn_degree(m)
            parity_check(m) = parity_check(m) + x_hat(H_row_one_absolute_index(m, k));
        end
    end
    if ~sum(mod(parity_check, 2))%early stop, to see whether Hx = 0.
        iter_this_time = t;
        break;
    end
end

 注:以上代码并不是最优的,最优算法参见上一篇博文。

四、写在最后

        写者学习QC-LDPC硬件实现的总结笔记。主要参考了白老师的书籍,自己在其中做了一些理解和总结,如有错误,请多指教。如果有相关问题,欢迎与我交流。

参考文献

[1] 白宝明 孙韶辉 王加庆. 5G 移动通信中的信道编码[M]. 北京: 电子工业出版社, 2018.

[2] William E. Ryan, Shu Lin. Channel Codes - Classical and Modern[M]. Cambridge University Press, 2009.

[3] Gallager R. Low-density parity-check codes[J]. IRE Transactions on information theory, 1962, 8(1): 21-28.

[4] Roberts M K, Anguraj P. A Comparative Review of Recent Advances in Decoding Algorithms for Low‑Density Parity‑Check (LDPC) Codes and Their Applications. 2021

  • 8
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值