1 Star 0 Fork 323

alike/cybersectookits

forked from openKylin/cybersectookits 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CDL_Channel_UMa_NLos_generate.m 4.92 KB
一键复制 编辑 原始数据 按行查看 历史
鲁鑫 提交于 2023-05-11 08:16 . uma
function [fc,tauNLos,PNLosdb,PhiAOA,PhiAOD,PhiZOA,PhiZOD,K,CASDNLos,CASANLos,...
CZSDNLos,CZSANLos,XPRNLos] = CDL_Channel_UMa_NLos_generate(phiLosAOA)
% initial parameters
NL = 19; % Number of initial clusters (NLos)
M = 20; % Number of rays per cluster
fc = 3.6e9; % 载波中心频率
fcLSP = 6; % Table 7.5-6 NOTE 7: For UMi and frequencies below 2 GHz, use fc = 2 when determining the values of the frequency-dependent LSP values
% LSP?
d2D = 300; % BS 和 UT间的平面距离
hUT = 1.5; % 用户高度(最低)
hBS = 25;
% 初始仰角固定,平面角可调
% TR38.901 7.5 step 1.c
phiLosAOD = 180 - phiLosAOA;
phiLosZOA = atan((hBS - hUT) / d2D) * 180 / pi + 90;
phiLosZOD = 180 - phiLosZOA;
% LOS和NLOS条件下的ZSD均值与偏置,Table 7.5-7
miulogZSDNLos = max(-0.5,(-2.1) * (d2D / 1000) + 0.01 * max((hUT - hBS),0) + 0.2);
miuoffsetZODNLos = (-1) * 10^((-1.5) * log10(max(10,d2D)) + 3.3);
% Generate large scale parameters
% e.g. delay spread (DS), angular spreads (ASA, ASD, ZSA, ZSD), Ricean K factor (K) and shadow fading (SF)
% TR38.901 Table 7.5-6 Part-1
LGDsNLos = normrnd(-6.83 - 0.24 * log10(1 + fcLSP),0.16 + 0.28 * log10(1 + fcLSP));
DsNLos = 10 ^ LGDsNLos; % DelaySpread(NLOS)
LGASDNLos = normrnd(1.53 - 0.23 * log10(1 + fcLSP),0.33 + 0.11 * log10(1 + fcLSP));
LGASANLos = normrnd(1.81 - 0.24 * log10(1 + fcLSP),0.3 - 0.05 * log10(1 + fcLSP));
LGZSANLos = normrnd(0.92 - 0.04 * log10(1 + fcLSP),0.41 - 0.07 * log10(1 + fcLSP));
LGZSDNLos = normrnd(miulogZSDNLos,0.35);
ASDNLos = 10 ^ LGASDNLos;
ASANLos = 10 ^ LGASANLos;
ZSANLos = 10 ^ LGZSANLos;
ZSDNLos = 10 ^ LGZSDNLos;
thetaSFNLos = 7.82;
% K = normrnd(9,3.5);
K = 9;
rtauNLos = 2.1;
XPRNLos = normrnd(8,3);
Cds = 11e-9;
CASDNLos = 10;
CASANLos = 22;
CZSANLos = 7;
CZSDNLos = 3;
% Per cluster shadowing std
std = 3;
% Generate cluster delays
for n = 1:NL
Xd(n) = rand;
tauTemp(n) = (-1) * rtauNLos * DsNLos * log(Xd(n));
end
tauTemp2 = sort(tauTemp); % 对随机生成的时延进行升序排序
tau = tauTemp2 - tauTemp2(1); % 归一化,保证第一个簇时延为0
% LOS情况下的处理,该值不参与功率的计算。NLOS条件下不需要
% Ctau = 0.7705 - 0.0433 * K + 0.0002 * K^2 + 0.000017 * K^3;
% tauLosTemp = tau / Ctau;
% Generate cluster powers
sum = 0; % total powers
for n = 1:NL
Zd(n) = normrnd(0,std);
Ptemp(n) = exp((-1) * tau(n) * (rtauNLos - 1) / rtauNLos / DsNLos) * 10 ^ ((-1) * Zd(n) / 10);
sum = sum + Ptemp(n);
end
P = Ptemp / sum; % 归一化,使各簇功率之和为1
Pdb = 10 * log10(P); % 计算db
% LOS情况下的处理,NLOS条件下不需要
% lamda = 25; % 比例因子,该值可调
% KR = K / lamda;
% P1Los = KR / (KR + 1);
% PLosTemp(1) = (1 / (KR + 1)) * (Ptemp(1) / sum) + P1Los;
% 删除功率过低的簇
delete = 0;
for n = 1:NL
if Pdb(n) < - 24
for i = n:NL-1
P(i) = P(i+1);
tau(i) = tau(i+1);
end
delete = delete + 1;
end
end
NL = NL - delete;
for n = 1:NL
PNLos(n) = P(n);
end
PNLosdb = 10 * log10(PNLos);
% 删除功率过低的簇
for n = 1:NL
tauNLos(n) = tau(n);
end
% Generate arrival angles and departure angles for both azimuth and elevation
CphiLos = 1.123 * (1.1035 - 0.028 * K - 0.002 * K^2 - 0.0001 * K^3);
CphiNLos = 1.123;
% PLosmax = max(PLos);
PNLosmax = max(P);
for n = 1:NL
PhiAOAtemp(n) = 2 * (ASANLos / 1.4) * sqrt((-1) * log(PNLos(n)/ PNLosmax)) / CphiNLos;
Xta(n) = randsrc(1);
Yta(n) = normrnd(0,ASANLos / 7);
PhiAOA(n) = Xta(n) * PhiAOAtemp(n) + Yta(n) + phiLosAOA;
if PhiAOA(n) < -180
PhiAOA(n) = PhiAOA(n) + 180;
elseif PhiAOA(n) > 180
PhiAOA(n) = PhiAOA(n) -180;
end
end
for n = 1:NL
PhiAODtemp(n) = 2 * (ASDNLos / 1.4) * sqrt((-1) * log(PNLos(n)/ PNLosmax)) / CphiNLos;
Xtd(n) = randsrc(1);
Ytd(n) = normrnd(0,ASDNLos / 7);
PhiAOD(n) = Xtd(n) * PhiAODtemp(n) + Ytd(n) + phiLosAOD;
if PhiAOD(n) < -180
PhiAOD(n) = PhiAOD(n) + 180;
elseif PhiAOD(n) > 180
PhiAOD(n) = PhiAOD(n) -180;
end
end
CthetaLos = 1.031 * (1.3086 - 0.0339 * K - 0.0077 * K^2 - 0.0002 * K^3);
CthetaNLos = 1.031;
for n = 1:NL
PhiZOAtemp(n) = (-1) * ZSANLos * log(PNLos(n)/ PNLosmax) / CthetaNLos;
Xtd2(n) = randsrc(1);
Ytd2(n) = normrnd(0,ZSANLos / 7);
PhiZOA(n) = Xtd2(n) * PhiZOAtemp(n) + Ytd2(n) + phiLosZOA;
if PhiZOA(n) < -180
PhiZOA(n) = PhiZOA(n) + 180;
elseif PhiZOA(n) > 180
PhiZOA(n) = PhiZOA(n) -180;
end
end
for n = 1:NL
PhiZODtemp(n) = (-1) * ZSDNLos * log(PNLos(n)/ PNLosmax) / CthetaNLos;
Xta2(n) = randsrc(1);
Yta2(n) = normrnd(0,ZSDNLos / 7);
PhiZOD(n) = Xta2(n) * PhiZODtemp(n) + Yta2(n) + phiLosZOD + miuoffsetZODNLos;
if PhiZOD(n) < -180
PhiZOD(n) = PhiZOD(n) + 180;
elseif PhiZOD(n) > 180
PhiZOD(n) = PhiZOD(n) -180;
end
end
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hua-xiangyang/cybersectookits.git
git@gitee.com:hua-xiangyang/cybersectookits.git
hua-xiangyang
cybersectookits
cybersectookits
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385