?? capacity_main.m
字號:
function capacity
%輸出2-2系統(tǒng)的各態(tài)歷經(jīng)和截止容量
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系統(tǒng)的信道容量
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');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -