%% % For more details: % A. Elkelesh, M. Ebada, S. Cammerer, L. Schmalen and S. ten Brink, "Decoder-in-the-Loop: Genetic Optimization-Based LDPC Code Design," in IEEE Access, 2019. % DOI: 10.1109/ACCESS.2019.2942999 % IEEE URL: https://ieeexplore.ieee.org/document/8846017 % arXiv URL: https://arxiv.org/abs/1903.03128 % elkelesh@inue.uni-stuttgart.de %% % See Fig. 2 in the paper clear all; close all; clc; rng('shuffle'); parpool(24); tic; N = 128; % number of VNs m = 64; % number of CNs R = 0.5; % code rate name = 'population1.mat'; load(name); % To get started, our initial population (i.e., population 1) contains a set of randomly constructed regular (3,6) LDPC codes pop_index=1; while true %%%%% Population N_pop tic; pop_index = pop_index + 1; name = ['population' num2str(pop_index) '.mat']; all_Hs = population_update(all_Hs,BLERs,R); S=size(all_Hs,1); save('H_matrices.mat'); BLERs = nan(1,S); for H_count = 1:S BLERs(H_count) = compute_BLER( squeeze(all_Hs(H_count,:,:)) , R ); save('status_BLER_Done.mat','H_count'); end timeNeeded = toc; save(name); end
时间: 2024-04-07 11:31:52 浏览: 21
这段代码实现了论文 "Decoder-in-the-Loop: Genetic Optimization-Based LDPC Code Design" 中的基因优化算法来设计低密度奇偶校验码。代码中的注释提供了论文和相关的细节信息。下面是这段代码的主要步骤:
1. 清空所有变量,关闭所有图形窗口,清除命令行窗口。
2. 使用"shuffle"函数对随机数生成器进行重新设置,以确保每次运行代码时都会产生不同的随机种子序列。
3. 使用"parpool"函数创建一个具有24个工作进程的并行池对象,以便加速后续的代码运行。
4. 设置一些基本参数,如VN数量、CN数量、码率等。
5. 加载初始种群的信息,这个初始种群是由随机构建的(3,6)正则LDPC码构成的。
6. 进入一个无限循环,循环体中执行以下操作:
a. 更新种群中所有码的H矩阵,以便进行下一轮优化。
b. 计算每个码的误码率,并将结果存储在"BLERs"数组中。
c. 将"BLERs"数组和所有码的H矩阵存储为.mat文件。
d. 继续循环,直到达到停止条件。
在这个代码中,主要的优化算法是基因优化。该算法通过对码的H矩阵进行适应性评估,然后对码进行交叉和变异,以产生新的优秀码。通过反复执行这个过程,最终得到一个具有优异性能的LDPC码。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![apk](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![m](https://img-home.csdnimg.cn/images/20210720083646.png)