当前位置:网站首页>[MATLAB project combat] LDPC-BP channel coding
[MATLAB project combat] LDPC-BP channel coding
2022-07-31 23:32:00 【big peach technique】
除了Turbo码之外, Gallger于 1960Low-density checksums proposed in (Low Density ParityCheck,LDPC)The code can also approach the Shannon world.This section describes binaryLDPCcode simulation







different symbol lengthsWER变化情况:
从图中可以看出,Code length is an influenceLDPCan important factor in code performance,LDPCThe decoding performance of the code is significantly improved with the increase of the code length.码长为1024The code is longer than the code length512The encoding has a performance of approx0.5dB的提高
主程序:
clc;clear all;
SNRdB=0:0.25:3; %SNR in dB
k=512/4;
n=1024/4; % 码长
niter= 60;% Maximum iteration at this time
nb_err = zeros(1,length(SNRdB));
nb_code = zeros(1,length(SNRdB));
nb_err_max= 100 ;
nb_code_max= 1e4;
H= gen_h(n,6,3);% 产生H
[Hs,H]=gen_Hs(H); % into a system code
Q= Hs(:,1:k)'; % generate a matrixQ
for s= 1:length(SNRdB)
sigma = 10^(-SNRdB(s)/20);% Its square is the noise power
while nb_err(s)<nb_err_max && nb_code(s)<nb_code_max
nb_code(s) = nb_code(s)+1;
b = rand(1,k)<0.5;
c=[b,rem(b*Q,2)];% System code encoding
x=(-1).^c;% BPSK modulation
noise = sigma * randn(1,length(x));
y = x+noise;
lam_ch= 2*y/sigma^2;%soft demodulation
hat_c= msa(lam_ch,niter,H);
err = any(hat_c~=c); %cis the transmit codeword,hat_cis a hard judgment
if err
nb_err(s)= nb_err(s)+err;
disp([nb_err;nb_code])
end
end
end
WER= nb_err./nb_code;
EbN0dB= SNRdB+10*log10(n/k/2);%化成Eb/N0,参考式(1)
figure(1)
semilogy(EbN0dB, WER,'o-','LineWidth',2)
xlabel('Eb/N0')
ylabel('WER')
grid on;
hold on
SNRdB=0:0.25:3; %SNR in dB
k=512/2;
n=1024/2; % 码长
niter= 60;% Maximum iteration at this time
nb_err = zeros(1,length(SNRdB));
nb_code = zeros(1,length(SNRdB));
nb_err_max= 100 ;
nb_code_max= 1e4;
H= gen_h(n,6,3);% 产生H
[Hs,H]=gen_Hs(H); % into a system code
Q= Hs(:,1:k)'; % generate a matrixQ
for s= 1:length(SNRdB)
sigma = 10^(-SNRdB(s)/20);% Its square is the noise power
while nb_err(s)<nb_err_max && nb_code(s)<nb_code_max
nb_code(s) = nb_code(s)+1;
b = rand(1,k)<0.5;
c=[b,rem(b*Q,2)];% System code encoding
x=(-1).^c;% BPSK modulation
noise = sigma * randn(1,length(x));
y = x+noise;
lam_ch= 2*y/sigma^2;%soft demodulation
hat_c= msa(lam_ch,niter,H);
err = any(hat_c~=c); %cis the transmit codeword,hat_cis a hard judgment
if err
nb_err(s)= nb_err(s)+err;
disp([nb_err;nb_code])
end
end
end
WER= nb_err./nb_code;
EbN0dB= SNRdB+10*log10(n/k/2);%化成Eb/N0,参考式(1)
figure(1)
semilogy(EbN0dB, WER,'s-','LineWidth',2)
xlabel('Eb/N0')
ylabel('WER')
grid on;
hold on
SNRdB=0:0.25:3; %SNR in dB
k=512;
n=1024; % 码长
niter= 60;%Maximum iteration at this time
nb_err = zeros(1,length(SNRdB));
nb_code = zeros(1,length(SNRdB));
nb_err_max= 100 ;
nb_code_max= 1e4;
H= gen_h(n,6,3);%产生H
[Hs,H]=gen_Hs(H); %into a system code
Q= Hs(:,1:k)'; %generate a matrixQ
for s= 1:length(SNRdB)
sigma = 10^(-SNRdB(s)/20);%Its square is the noise power
while nb_err(s)<nb_err_max && nb_code(s)<nb_code_max
nb_code(s) = nb_code(s)+1;
b = rand(1,k)<0.5;
c=[b,rem(b*Q,2)];%System code encoding
x=(-1).^c;%BPSK modulation
noise = sigma * randn(1,length(x));
y = x+noise;
lam_ch= 2*y/sigma^2;%soft demodulation
hat_c= msa(lam_ch,niter,H);
err = any(hat_c~=c); %cis the transmit codeword,hat_cis a hard judgment
if err
nb_err(s)= nb_err(s)+err;
disp([nb_err;nb_code])
end
end
end
WER= nb_err./nb_code;
EbN0dB= SNRdB+10*log10(n/k/2);%化成Eb/N0,参考式(1)
figure(1)
semilogy(EbN0dB, WER,'^-','LineWidth',2)
xlabel('Eb/N0')
ylabel('WER')
grid on;
legend('n=256','n=512','n=1024')
代码链接(包括word文档):https://download.csdn.net/download/qq_45047246/86268695
边栏推荐
- SQL注入 Less54(限制次数的SQL注入+union注入)
- 【FPGA教程案例43】图像案例3——通过verilog实现图像sobel边缘提取,通过MATLAB进行辅助验证
- ICML2022 | 深入研究置换敏感的图神经网络
- thymeleaf iterates the map collection
- lua入门案例实战1234定义函数与标准函数库功能
- 周总结
- 基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
- The role of /etc/resolv.conf
- @JsonFormat(pattern=“yyyy-MM-dd“)时间差问题
- 网络安全--通过握手包破解WiFi(详细教程)
猜你喜欢

Unity - LineRenderer show a line

Design of Fire and Anti-theft System Based on Single Chip GSM

(26) About menu of the top menu of Blender source code analysis

Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix

消息队列存储消息数据的MySQL表格

VOT2021 game introduction

面试突击69:TCP 可靠吗?为什么?

游戏安全03:缓冲区溢出攻击简单解释

嵌入式开发没有激情了,正常吗?

网络安全--通过握手包破解WiFi(详细教程)
随机推荐
mysql having的用法
UOS统信系统 - WindTerm使用
输入输出优化
SQL注入 Less46(order by后的注入+rand()布尔盲注)
博弈论(Depu)与孙子兵法(42/100)
/etc/sysconfig/network-scripts configure the network card
uniapp小程序检查、提示更新
编程语言是什么
Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
【1161. 最大层内元素和】
C# Rectangle基本用法和图片切割
UOS - WindTerm use
[QNX Hypervisor 2.2用户手册]9.15 suppress
浏览器下载快捷方式到桌面(PWA)
Program processes and threads (concurrency and parallelism of threads) and basic creation and use of threads
消息队列消息存储设计(架构实战营 模块八作业)
不知道该怎么办的同步问题
【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀
逐步手撕轮播图3(保姆级教程)
程序进程和线程(线程的并发与并行)以及线程的基本创建和使用