?? capacity_plot.asv
字號:
function output=capacity_plot(SNR,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
%SNR is signal-to-noise ratio in dBs
%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
%*********************************************************************
%
% M=2;
% SNR=10;
% corr=1;
% XPD=1;
% value=0.2;
% alpha=0.5;
% SNR=10^(0.1*SNR);
% output='out';
%10000 Monte-Carlo runs
for K=1:10000
T=randn(M,M)+j*randn(M,M);
T=0.707*T;
if corr
T=zeros(M,M);
T=T+value;
for i=1:M,
T(i,i)=1;
end
elseif XPD
T=[1 alpha;alpha 1];
T=chol(T);
end
[v,d]=eig(T);
I=eye(M);
a=(I+(SNR/M)*d);
a=det(a);
y(K)=log2(abs(a));
end
[n1 x1]=hist(y,40);
n1_N=n1/max(K);
a=cumsum(n1_N);
b=abs(x1);
if output == 'erg'
output=interp1q(a,b',0.5); %ergodic capacity
elseif output == 'out'
output=interp1q(a,b',0.1); %outage capacity
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -