📄 losprobability.m
字号:
function indLOS=LOSprobability(wimpar,linkpar)
%LOSPROBABILITY Random LOS/NLOS condition generation for WIM
% INDLOS=LOSPROBABILITY(WIMPAR,LINKPAR) is a vector defining links
% propagation condition. Vector elements have values '0' or '1' and length is
% number of links. '0' stands for NLOS and '1' stands for LOS link,
% vector length is number of links. LOS/NLOS condition is drawn randomly
% for each link according to LOS probabilities defined in [1, eq. 3.20-25].
%
% Ref. [1]: D5.4, "Final Report on Link Level and System Level Channel Models"
%
% See also WIM, WIMPARSET, LINKPARSET, ANTPARSET.
% Authors: Pekka Ky鰏ti (EBIT)
Scenario = wimpar.Scenario;
MsBsDistance = linkpar.MsBsDistance;
NumLinks = length(MsBsDistance);
% Probability of LOS
switch upper(Scenario) % See equations 3.20-25 in [1, sect 3.1.6 ]
case {'A1'}
dBp = 2.5; % max distance of LOS probability 1 [m]
pLOS = ones(size(MsBsDistance));
indBp = MsBsDistance > dBp;
pLOS(indBp) = 1-0.9*(1-(1.24-0.61*log10(MsBsDistance(indBp))).^3).^(1/3);
case {'B1'}
% NOTE! Find out how to get Dist1 and Dist2 here.
% dBp = 15; % max distance of LOS probability 1 [m]
% pLOS = ones(size(MsBsDistance));
% indBp = MsBsDistance > dBp;
% pLOS(indBp) = 1-(1-(1.56-0.48*log10(sqrt(Dist1(indBp).^2+Dist2(indBp).^2))).^3).^(1/3);
error('Currently LOSprobability cannot be used with scenario B1')
case {'B3'}
% Scenario B3 has two LOS probability functions, default is eq 3.22
% P(LOS) for big factory halls, airport and railway stations
dBp = 10; % max distance of LOS probability 1 [m]
pLOS = ones(size(MsBsDistance));
indBp = MsBsDistance > dBp;
pLOS(indBp) = exp(-(MsBsDistance(indBp)-10)/45);
% P(LOS) for big lecture halls or conference halls
% dBp = 5; % max distance of LOS probability 1 [m]
% pLOS = ones(size(MsBsDistance));
% indBp = MsBsDistance > dBp;
% pLOS(indBp) = 1-(MsBsDistance(indBp)-5)/150;
% if sum(MsBsDistance > 40)>0;
% warning('MsBsDistance exceeds maximum 40 m in B3 P(LOS) computation')
% end
case {'C1'}
pLOS = exp(-MsBsDistance/500);
case {'C2'}
pLOS = zeros(size(MsBsDistance)); % only NLOS considered
case {'D1'}
pLOS = exp(-MsBsDistance/1000);
end
% output, 0 for NLOS and 1 for LOS links
indLOS = rand(1,NumLinks)<pLOS;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -