?? capacity_plot_main.m
字號:
function z=capacity_plot_main(M,corr,value,XPD,alpha,output)
%**************************************************************************
%This program works with "capacity_plot_main.m" file.Figs
%2.6,2.7,2.9,2.12 are determined using this program. It operates on
%file "capacity_plot.m"
%z=capacity_plot_main(M,corr,value,ric,k,XPD,alpha,output)
%M -> number of antennas (M x M) system
%corr -> 1 if with correlation, 0 if uncorrelated (for a 2x2 system only)
%value -> correlation coefficient value from 0 ->1
%XPD -> 1 if antenna XPD is to be investigated, 0 if not (for a 2x2 system
%only)
%alpha -> XPD value
%output -> defined by 'erg' and 'out' for ergodic capacity or outage
%capacity respectively
%EXAMPLE: capacity_plot_main(2,1,0.5,1,0.5,'out')-> determines the outage
%capacity for a 2x2 system with a correlation of 0.5 and an XPD of 0.5
%**************************************************************************
%vary SNR through 20 dB
M=4;
corr=0;
XPD=0;
output='out';
value=0.1;
alpha=0.2;
for n=1:M,
SNR=0:1:10;%SNR is signal-to-noise ratio in dBs
temp2=[];
for i=1:length(SNR)
temp1(i)=capacity_plot(SNR(i),n,corr,value,XPD,alpha,output);% change this file to suit requirements e.g. capacity_rician,
% capacity_water(for water-filling) etc.
temp2=[temp2 temp1(i)];
temp1(i)=0;
end
temp3(n,:)=temp2;
end
plot(SNR,temp3(1,:),'b*-',SNR,temp3(2,:),'r*-',SNR,temp3(3,:),'k*-',SNR,temp3(4,:),'y*-');
grid;
%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 and XPD = 0']);
legend('Mt=Mr=1','Mt=Mr=2','Mt=Mr=3','Mt=Mr=4')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -