capacity_main.m

来自「多输入多输出系统不同收发天线对系统性能的影响」· M 代码 · 共 47 行

M
47
字号
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 + =
减小字号Ctrl + -
显示快捷键?