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

📄 wilkinson.m

📁 一个简单的蜂窝无线通信系统建模与仿真,含课件
💻 M
字号:

function [m_out,std_out] = wilkinson(m_x,std_x,r)
%
% This function computes the mean and standard deviation 
% of the sum of two lognormal RV's.
% Input and ouput values are in dB.
%
lambda = 0.1*log(10);
m_x_cmp = m_x;
v_x_cmp = std_x.^2;
m_y = lambda*m_x_cmp;
v_y = (lambda^2)*v_x_cmp;
u_1 = 0;
for i = 1:length(m_y)
   u_1 = u_1 + exp(m_y(i) + v_y(i)/2);
end
a = 0;
for i = 1:length(m_y)
   a = a + exp(2*m_y(i) + 2*v_y(i));
end
b = 0;
for i = 1:length(m_y)-1
   for j = i+1:length(m_y)
      b = b + exp( m_y(i) + m_y(j) )*...
          exp(0.5*(v_y(i) + v_y(j)  + ...
          2*r*sqrt(v_y(i))*sqrt(v_y(j))));
   end
end
u_2 = a + 2*b;
%
% mean and variance or the variable Z, which is normal in natural units
%
m_z = 2*log(u_1) - 0.5*log(u_2);
std_z = sqrt(log(u_2) - 2*log(u_1));
%
% mean and variance of the variable X, which is normal in dB.
%
g = 10*log10(exp(1));
m_out = g*m_z;
std_out = g*std_z;
% End of function file.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -