⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 capacity_rician.m

📁 通信系统仿真原理与无线应用 所有的代码
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -