资源简介
ldpc的编码方法采用matlab构造校验矩阵,程序比较长,但是看起来一目了然,希望对大家有用
代码片段和文件信息
%function [H]=genH(rowscols)
rows=12;
cols=24;
row_flag(1:rows)=0;
parity_check=zeros(rowscols);
%add bits_per_col 1‘s to each column with the only constraint being that the 1‘s should be
%placed in distinct rows
%%%%%%%%使每列随机产生3个1即列重为3%%%%%%%%%%%%%
bits_per_col=3;
for i=1:cols
a=randperm(rows);
for j=1:bits_per_col
parity_check(a(j)i)=1;
row_flag(a(j))=row_flag(a(j))+1;
end
end
%计算每行1的最多个数
max_ones_per_row=ceil(cols*bits_per_col/rows);
%add 1‘s to rows having no 1(a redundant row) or only one 1(that bit in the codeword becomes
%zero irrespective of the input)
for i=1:rows
if row_flag(i)==0 %如果该行没有1,则随机添加两个1
for k=1:2
j=unidrnd(cols);
while parity_check(ij)==1
j=unidrnd(cols);
end
parity_check(ij)=1; %在找到的新位置上置1
row_flag(i)=row_flag(i)+1; %行重加1
end
end
if row_flag(i)==1 %如果该行只有1个1,则随机再添加1个1
j=unidrnd(cols);
while parity_check(ij)==1
j=unidrnd(cols);
end
parity_check(ij)=1;
row_flag(i)=row_flag(i)+1;
end
end
%try to distribute the ones so that the number of ones per row is as uniform as possible
%尝试在列上分散1的位置,使得每行1的个数均衡(相近或相一致)
for i=1:rows
j=1;
a=randperm(cols);
while row_flag(i)>max_ones_per_row; %如果该行行重大于允许的最大行重,则进行处理
if parity_check(ia(j))==1 %随机选择某一该行上为1的列来处理,将该列该行上的1分散到其他的行
%随机查找该列上适合放置1(行重小于允许的最大行重,且该位置上为0)的行
newrow=unidrnd(rows);
k=0;
while (row_flag(newrow)>=max_ones_per_row | parity_check(newrowa(j))==1) & k newrow=unidrnd(rows);
k=k+1;
end
if parity_check(newrowa(j))==0
%将待处理行上的1转放到找到的行上
parity_check(newrowa(j))=1;
row_flag(newrow)=row_flag(newrow)+1;
parity_check(ia(j))=0;
row_flag(i)=row_flag(i)-1;
end
end%if test
j=j+1;
end%while loop
end%for loop
%try to eliminate cycles of length 4 in the factor graph
%尝试删除4环
for loop=1:10
chkfinish=1;
for r=1:rows
ones_position=find(parity_check(r:)==1);
on
- 上一篇:三维点云的配准和融合
- 下一篇:EMD经验模态分解MATLAB源代码,非常好用
相关资源
- Ldpc编译码方案MATLAB仿真
- 基于MATLAB的低密度奇偶校LDPC验码编码
- LDPC编译码器Matlab代码及参考资料
- LDPC码编译码器的matlab实现
- LDPC编码解码matlab代码和Verilog代码及资
- LDPC编码解码FPGA Verilog+MATLAB
- LDPC编解码的MATLAB仿真实现
- 可变码率LDPC的MATLAB实现
- QC-LDPC码的编码和译码程序
- GALLAGER校验矩阵详细构造代码
- LDPC码编译码仿真
- LDPC码MATLAB程序
- LDPC仿真,matlab BP算法 LDPC编解码的m
- LDPC编译码MATLAB程序,可以直接运行程
- 多进制纠错码LDPC编译码matlab算法仿真
- 删除信道下的LDPC码 编译码
- ldpc MATLAB
- GIRTH8 QC-LDPC MATLAB源码
- LDPC 的编译码MATLAB仿真
-
SIMUli
nk仿真实现LDPC信道编码 - LDPC的matlab 仿真 BP算法 BPSK调制
- LDPC BP算法
- qc_ldpc矩阵构造
- 基于MATLAB的LDPC码的仿真
- LDPC编码的matlab实现
- matlab的LDPC实现
- LDPC在AWGN性能仿真
- QC-LDPC码的校验矩阵构造
- ldpc ms算法
- ldpc迭代算法
评论
共有 条评论