clc;
clear;
close all;xindao_SD=2;
xindao_SR=1;
xindao_RD=1.5;
M =16; % 10种发射信噪比情况
R=2;
SNR_S = zeros(1,M); % 源发射信噪比数组
SNR = zeros(1,M); % 源发射信噪比(dB值)
Error_wu = zeros(1,M); % 中断概率实验值
Error_af = zeros(1,M);
Error_df = zeros(1,M);
Error_new = zeros(1,M);
for kk = 1:M
kk
SNR(kk) =kk;
SNR_S(kk) = 10^(SNR(kk)/10);
Error_wu(kk) = simu_yan(R,SNR_S(kk),xindao_SD);
Error_af(kk) = af_simu_yan(R,SNR_S(kk),xindao_SD,xindao_SR,xindao_RD);
Error_df(kk) = df_simu(R,SNR_S(kk),xindao_SR,xindao_SD,xindao_RD);
Error_new(kk)= new_simu_yan(R,SNR_S(kk),xindao_SR,xindao_SD);% 调用中断概率实验值求解函数
end
semilogy(SNR,Error_wu,'--d');
hold on
semilogy(SNR,Error_af,'--*');
hold on
semilogy(SNR,Error_df,'--+');
hold on
semilogy(SNR,Error_new,'--o');
xlabel('SNR/dB');
ylabel('Pr实验值');
legend('无协作','AF协议','DF协议','改进方法')
D99
标签:误码率,xindao,DF,AF,kk,SNR,Error,zeros,SD From: https://blog.51cto.com/u_15815923/5744754