当前位置:网站首页>[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
边栏推荐
猜你喜欢

Unity - by casting and cloning method dynamic control under various UGUI create and display
![[Reading Notes -> Data Analysis] 02 Data Analysis Preparation](/img/e7/258daf851746cb043f301437ee3bbe.png)
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation
![[1161. The maximum sum of elements in the layer]](/img/59/7810f425431779aa719458038ea0b3.png)
[1161. The maximum sum of elements in the layer]

cobaltstrike

Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决

SVN server construction + SVN client + TeamCity integrated environment construction + VS2019 development

编译型语言和解释型语言的区别

网易云信圈组上线实时互动频道,「破冰」弱关系社交

【Acwing】第62场周赛 题解

【读书笔记->数据分析】02 数据分析准备
随机推荐
什么是动态规划,什么是背包问题
PHP三元(三目)运算符
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none failed
《ArchSummit:时代的呐喊,技术人听得到》
游戏安全03:缓冲区溢出攻击简单解释
EntityFramework保存到SQLServer 小数精度丢失
基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
编程语言是什么
无状态与有状态的区别
C# Rectangle basic usage and picture cutting
Drawing process of hand-drawn map of scenic spots
Pytest初体验
编译型语言和解释型语言的区别
(26) About menu of the top menu of Blender source code analysis
LeetCode 第 304 场周赛
C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
SQL注入 Less38(堆叠注入)
Unity - LineRenderer show a line
Flutter教程之 02 Flutter 桌面程序开发入门教程运行hello world (教程含源码)
【读书笔记->数据分析】02 数据分析准备