1 Star 0 Fork 323

just for test/cybersectookits

forked from openKylin/cybersectookits 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CDL_Channel_UMi_Los_generate.m 5.18 KB
一键复制 编辑 原始数据 按行查看 历史
seu_ss 提交于 2023-05-13 08:56 . CDL_UMi_Code
function [fc,tauLos,PLosdb,PhiAOA,PhiAOD,PhiZOA,PhiZOD,K,CASDLos,CASALos,...
CZSDLos,CZSALos,XPRLos] = Process_CDL_Channel_UMi_Los_generate(phiLosAOA)
% 本程序使用的模型为UMi模型(Los)(CDL-D)
rng(3 * phiLosAOA + 1);
% initial parameters
NL = 12; % Number of initial clusters (Los)
M = 20; % Number of rays per cluster
fc = 3.6e9; % 载波中心频率
fcLSP = 3.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
d2D = 300; % BS 和 UT间的平面距离
hUT = 1.5; % 用户高度(最低)
hBS = 10;
% 初始仰角固定,平面角可调
% 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
miulogZSDLos = max(-0.21,(-14.8) * (d2D / 1000) + 0.01 * (hBS - hUT) + 0.83);
miuoffsetZODLos = 0;
% 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
LGDsLos = normrnd(-7.14 - 0.24 * log10(1 + fcLSP),0.38);
DsLos = 10 ^ LGDsLos; % DelaySpread(LOS)
LGASDLos = normrnd(-0.05 + 1.21 * log10(1 + fcLSP),0.41);
LGASALos = normrnd(1.73 - 0.08 * log10(1 + fcLSP),0.28 + 0.014 * log10(1 + fcLSP));
LGZSALos = normrnd(0.73 - 0.1 * log10(1 + fcLSP),0.34 - 0.04 * log10(1 + fcLSP));
LGZSDLos = normrnd(miulogZSDLos,0.35);
ASDLos = min(10 ^ LGASDLos,52);
ASALos = min(10 ^ LGASALos,52);
ZSALos = min(10 ^ LGZSALos,52);
ZSDLos = min(10 ^ LGZSDLos,52);
thetaSFLos = 4;
% K = normrnd(9,3.5);
K = 19;
rtauLos = 3;
XPRLos = normrnd(9,3);
Cds = 5e-9;
CASDLos = 3;
CASALos = 17;
CZSALos = 7;
CZSDLos = 3;
% Per cluster shadowing std
std = 3;
% Generate cluster delays
for n = 1:NL
Xd(n) = rand;
tauTemp(n) = (-1) * rtauLos * DsLos * 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) * (rtauLos - 1) / rtauLos / DsLos) * 10 ^ ((-1) * Zd(n) / 10);
sum = sum + Ptemp(n);
end
P = Ptemp / sum; % 归一化,使各簇功率之和为1
Pdb = 10 * log10(P); % 计算db
% LOS情况下的处理,NLOS条件下不需要
lamda = 1; % 比例因子,该值可调
KR = K / lamda;
P1Los = KR / (KR + 1);
PLosTemp(1) = (1 / (KR + 1)) * (Ptemp(1) / sum) + P1Los;
% 删除功率过低的簇
delete = 0;
for n = 2:NL
PLosTemp(n) = (1 / (KR + 1)) * (Ptemp(n) / sum);
PLosdb(n) = 10 * log10(PLosTemp(n));
end
for n = 1:NL
if PLosdb(n) < - 15
for i = n:NL-1
PLosTemp(i) = PLosTemp(i+1);
tauLosTemp(i) = tauLosTemp(i+1);
end
delete = delete + 1;
end
end
NL = NL - delete;
for n = 1:NL
PLos(n) = PLosTemp(n);
end
PLosdb = 10 * log10(PLos);
% 删除功率过低的簇
for n = 1:NL
tauLos(n) = tauLosTemp(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 * (ASALos / 1.4) * sqrt((-1) * log(PLos(n)/ PLosmax)) / CphiLos;
Xta(n) = randsrc(1);
Yta(n) = normrnd(0,ASALos / 7);
PhiAOA(n) = (Xta(n) * PhiAOAtemp(n) + Yta(n)) - (Xta(1) * PhiAOAtemp(1) + Yta(1) - 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 * (ASDLos / 1.4) * sqrt((-1) * log(PLos(n)/ PLosmax)) / CphiLos;
Xtd(n) = randsrc(1);
Ytd(n) = normrnd(0,ASDLos / 7);
PhiAOD(n) = (Xtd(n) * PhiAODtemp(n) + Ytd(n)) - (Xtd(1) * PhiAOAtemp(1) + Ytd(1) - 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) * ZSALos * log(PLos(n)/ PLosmax) / CthetaLos;
Xtd2(n) = randsrc(1);
Ytd2(n) = normrnd(0,ZSALos / 7);
PhiZOA(n) = (Xtd2(n) * PhiZOAtemp(n) + Ytd2(n)) - (Xtd2(1) * PhiZOAtemp(1) + Ytd2(1) - 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) * ZSDLos * log(PLos(n)/ PLosmax) / CthetaLos;
Xta2(n) = randsrc(1);
Yta2(n) = normrnd(0,ZSDLos / 7);
PhiZOD(n) = (Xta2(n) * PhiZODtemp(n) + Yta2(n)) - (Xta2(1) * PhiZODtemp(1) + Yta2(1) - phiLosZOD);
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/seu_-pls_-li/cybersectookits.git
git@gitee.com:seu_-pls_-li/cybersectookits.git
seu_-pls_-li
cybersectookits
cybersectookits
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385