-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathh2corr.m
85 lines (77 loc) · 2.87 KB
/
h2corr.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
% H2CORR ITU 1546-1 Field strength calculator
% Calculate correction in dB for receiver antenna height different from standard.
%
% corr = h2corr(h2,f,env,d,h1,R)
% h2 : reciever antenna height above ground (may be a vector)
% f : frequency in MHz
% env: environment, sets representative clutter height. Possible inputs:
% - 'land' : sets R = 10m (default) - for open land (rural)
% - 'urban': sets R = 20m - for built-up areas
% - 'dense': sets R = 30m - for dense cities
% - 'open' : sets R = 10m and forces use of Kh2*log10(h2/R), also for h2<R'.
% Use this option in case antenna is adjacent to land in rural/open environment.
% d : distance to transmitter (optional)
% h1 : transmitter effective antenna height (optional)
% If d or h1 remains unset, R'=R is assumed. You may do this if h1 < 6.5*d + R.
% Set h2 = -1 to test if this is the case, whith d , h1 and R set.
% Function returns 6.5*d + R - h1, which is positive if h1 < 6.5*d + R
% R : Representative clutter height in m (optional). Set by the 'env' input, but non-standard
% values may be entered here, overruling the 'env' setting: 10m for rural, 20m for urban,
% 30m for dense urban.)
% Pierre Soelberg, http://broadcast-it.com, 2005-10-06
% Numbers refer to Rec. ITU-R P.1546-1
% Modified by Jeff Statham to remove warnings in Matlab R2007a and
% translate some comments
function corr = h2corr(h2,f,varargin)
%nargin
%varargin
force23b = 0; % set 1 if the condition of open country => use (27b) applies
if nargin>2
if nargin>5
R = varargin{4};
else
switch(lower(varargin{1}));
case {'open'}
R = 10;
force23b = 1;
case {'land'}
R = 10;
case {'urban'}
R = 20;
case {'dense'}
R = 30;
otherwise
error('Input variable env not understood - see help h2corr for details')
end
end
else
R = 10;
warning('env unspecified - assuming env=land and R = 10 m');
end
if nargin>4 % both d and h1 specified
d = varargin{2};
h1 = varargin{3};
if h2 == -1 % if we instead should test for R = R
corr = 6.5*d + R - h1;
return
end
Rm = (1000*d*R-15*h1)/(1000*d-15); % (26)
if Rm < 1
Rm = 1;
end
else
warning(['d or h1 unspecified - assuming modified representative clutter height is ',...
int2str(R),' m']);
Rm = R;
end
if h2<Rm && ~force23b
Knu = 0.0108*sqrt(f); % (27g)
h_dif = Rm - h2; % (27d)
theta_clut = atan(h_dif/27)/pi*180; % (27e)
ny = Knu*sqrt(h_dif.*theta_clut); % (27c)
J = 6.9 + 20*log10(sqrt((ny-0.1).^2+1)+ny-0.1); % (12a)
corr = 6.03-J; % (27a)
else
Kh2 = 3.2+6.2*log10(f); % (27f)
corr = Kh2*log10(h2/Rm); % (27b)
end