capacity_rician.m
来自「This chapter contains sample programs fo」· M 代码 · 共 35 行
M
35 行
function outage=capacity_rician(SNR,M,k,output)
%**************************************************************************
%This program illustrates the coding for determining the capacity in the
%presence of a Rician component (0.8) in this example. The k-factor is
%varied from 0 -> 20 (see Fig. 2.14). A suitable control program needs to
%be written similar to "capacity_plot_main.m" for fixed SNR and varying
%k-factor
%**************************************************************************
SNR=10^(0.1*SNR);
for K=1:10000
T=randn(M,M)+j*randn(M,M);
T=0.707*T;
%Rician component of 0.8 (choose any value upto 1)
H=[1 1;1 1];
T=sqrt(k/(1+k))*H+sqrt(1/(1+k))*T;
I=eye(M);
a=det(I+(SNR/M)*T*T');
y(K)=log2(a);
end
[n1 x1]=hist(y,40);
n1_N=n1/max(K);
a=cumsum(n1_N);
b=abs(x1);
if output == 'erg'
outage=interp1q(a,b',0.5); %ergodic capacity
elseif output == 'out'
outage=interp1q(a,b',0.1); %outage capacity
end
%plot CDF (uncomment the following line if CDF is required)
% plot(abs(x1),a,'b');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?