主程序
%%%%%%%%%%%%%%%%%%%%%%%%% 改进的选择重传HARQ吞吐量性能 %%%%%%%%%%%%%%%%%%%%%%%%
clc;
clear all;
%BER = [10^-8:4*10^-8:10^-7 10^-7:4*10^-7:10^-6 10^-6:4*10^-6:10^-5 10^-5:10^-5:10^-4 10^-4:10^-4:10^-3 10^-3:10^-3:10^-2];
BER = [10^-8:4*10^-8:10^-7 10^-7:4*10^-7:10^-6 10^-6:4*10^-6:10^-5 10^-5:10^-5:10^-4 10^-4:10^-4:10^-3 10^-3:4*10^-3:10^-2];
BER_len = length(BER);
t=[3,5,10,21,25,30,57];%n=510,N=128
%t=[3,5,10,41,60,106];%n=1023,N=1024
%t=[3,5,10,82,140,198];%n=2044,N=512
t_len = length(t);
for j=1: t_len
t1=t(j);
log_BER = log10(BER);
throughput = zeros(1,BER_len);
throughput_cnt = 1;
for i = 1:BER_len
throughput(throughput_cnt) = Throughput(BER(i),t1);
throughput_cnt = throughput_cnt + 1;
end
if j==1
plot(log_BER,throughput,'r');
else if j==2
plot(log_BER,throughput,'-.');
else if j==3
plot(log_BER,throughput,'g');
else
plot(log_BER,throughput);
end
end
end
hold on;
grid on;
end
xlabel('Bit Error Rate');ylabel('Throughput Effiency');title('n=510 N=128');
axis([1e-8:1e-1:1e-2 0 1]);
%%%%%%%%%%%%%%%%%%%%%%%%% 改进的选择重传HARQ吞吐量性能 %%%%%%%%%%%%%%%%%%%%%%%%
clc;
clear all;
%BER = [10^-8:4*10^-8:10^-7 10^-7:4*10^-7:10^-6 10^-6:4*10^-6:10^-5 10^-5:10^-5:10^-4 10^-4:10^-4:10^-3 10^-3:10^-3:10^-2];
BER = [10^-8:4*10^-8:10^-7 10^-7:4*10^-7:10^-6 10^-6:4*10^-6:10^-5 10^-5:10^-5:10^-4 10^-4:10^-4:10^-3 10^-3:4*10^-3:10^-2];
BER_len = length(BER);
t=[3,5,10,21,25,30,57];%n=510,N=128
%t=[3,5,10,41,60,106];%n=1023,N=1024
%t=[3,5,10,82,140,198];%n=2044,N=512
t_len = length(t);
for j=1: t_len
t1=t(j);
log_BER = log10(BER);
throughput = zeros(1,BER_len);
throughput_cnt = 1;
for i = 1:BER_len
throughput(throughput_cnt) = Throughput(BER(i),t1);
throughput_cnt = throughput_cnt + 1;
end
if j==1
plot(log_BER,throughput,'r');
else if j==2
plot(log_BER,throughput,'-.');
else if j==3
plot(log_BER,throughput,'g');
else
plot(log_BER,throughput);
end
end
end
hold on;
grid on;
end
xlabel('Bit Error Rate');ylabel('Throughput Effiency');title('n=510 N=128');
axis([1e-8:1e-1:1e-2 0 1]);
