📄 capacity_main.m
字号:
function capacity
%输出2-2系统的各态历经和截止容量
SNR=0:1:10;%SNR is signal-to-noise ratio in dBs
subplot(2,1,1);
output=capacity(2,1,0.5,1,0.5,'out',SNR);
plot(SNR,output,'b-^');
%plot routines follow. These will change depending upon the type of plot.
%The following routines are based on the given example above
xlabel('SNR');
ylabel('Capacity (Bits/sec)');
title('Outage Capacity Variation with SNR for Corr = 0.5 and XPD = 0.5');
SNR=0:1:10;%SNR is signal-to-noise ratio in dBs
subplot(2,1,2);
output=capacity(2,1,0.5,1,0.5,'erg',SNR);
plot(SNR,output,'r-^');
%plot routines follow. These will change depending upon the type of plot.
%The following routines are based on the given example above
xlabel('SNR');
ylabel('Capacity (Bits/sec)');
title('ergodic Capacity Variation with SNR for Corr = 0.5 and XPD = 0.5');
grid;
%输出1-1、2-2、3-3、4-4系统的信道容量
output1=[];
output2=[];
for i=1:4,
output1(i,:)=capacity(i,0,0.5,0,0.5,'out',SNR);
output2(i,:)=capacity(i,0,0.5,0,0.5,'erg',SNR);
end
figure;
plot(SNR,output1(1,:),'r*-',SNR,output1(2,:),'b*-',SNR,output1(3,:),'k*-',SNR,output1(4,:),'g*-')
xlabel('SNR');
ylabel('Capacity (Bits/sec)');
title('Outage Capacity Variation with SNR for Corr = 0 and XPD = 0');
legend('1×1','2×2','3×3','4×4');
figure;
plot(SNR,output2(1,:),'r*-',SNR,output2(2,:),'b*-',SNR,output2(3,:),'k*-',SNR,output2(4,:),'g*-')
xlabel('SNR');
ylabel('Capacity (Bits/sec)');
title('Ergodic Capacity Variation with SNR for Corr = 0 and XPD = 0');
legend('1×1','2×2','3×3','4×4');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -