-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathP1546FieldStr.m
198 lines (170 loc) · 6.83 KB
/
P1546FieldStr.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
% P1546FieldStr ITU 1546-3 Field strength calculator
%
% E = P1546FieldStr(d,f,t,heff,ha,hb,path,FS_offset)
%
% where: Units, Definition Limits
% f: MHz, Operating frequency. 30-3000 MHz
% d: km, Path length. 1-1000 km
% t: %, Percentage time defined 1-50 %
% in Annex 1 sec 8.
% heff: m, the effective height of the >clutter m
% transmitting/base antenna, height over
% the average level of the ground between
% distances of 3 and 15 km from the
% transmitting/base antenna in the
% direction of the receiving/mobile antenna.
% ha: m, Transmitter antenna height above >clutter m
% ground. Defined in Annex 5 sec 3.1.1.
% Limits are defined in Annex 5 sec 3.
% hb: m, Height of base antenna above terrain none, d < 15 km
% height averaged 0.2 d and d km, where
% d is less than 15 km and where terrain
% information is available.
% path: String what type of field strength 'Land','Sea',
% calculations/tables should be used. 'Warm','Cold'
%FS_offset: dB microV/m Used to lower the field strenght value
% intended for use with find distance
% from field strength.
% Notes:
% If sea path is selected for a t value less then 50% the default 10% table
% use is a cold sea path.
% How to use:
% To use the function and have no input for a variable. The "standard" way
% is pass empty array for undefined inputs Ex:
% P1546FieldStr(150,700,10,500,[],[],'Sea')
%
%
% Jef Statham, Industry Canada 2009-08-13
% Numbers refer to Rec. ITU-R P.1546-3
function E = P1546FieldStr(d,f,t,heff,varargin)
if nargin > 8
warning(strcat('P1546FieldStrAlpha:TooManyInputs requires at most 7',...
'optional inputs additional values ignored. Input values may be wrongly assigned.'));
end
%defaults for optional inputs
defaultvalues = {[] [] 'Land' 0};
newValues = cellfun(@(x) ~isempty(x), varargin);
defaultvalues(newValues) = varargin(newValues);
[ha hb path FS_offset] = defaultvalues{:};
% Function limit(var, low, hi, name)
%
% Checks the var to see if it's inbetween the range low <= var <= hi
% returns false if it's in range true if not
function bool = limit(var, low, hi,name)
if ((var < low) || (var > hi))
error(strcat(name,' = ',num2str(var),' is out side of limit'));
bool = true;
return
end
bool = false;
end
% Checking passed parameter to the defined limits
if limit(f,30,3000,'f')
return
end
if limit(d,1,1000,'d')
return
end
if limit(t,1,50,'t')
return
end
if limit(heff,heff,3000,'heff');
return
end
% time,path,freq,figure
figure = [50,1,100 ,1;
10,1,100 ,2;
1,1,100 ,3;
50,2,100 ,4;
10,3,100 ,5;
1,3,100 ,6;
10,4,100 ,7;
1,4,100 ,8;
50,1,600 ,9;
10,1,600 ,10;
1,1,600 ,11;
50,2,600 ,12;
10,3,600 ,13;
1,3,600 ,14;
10,4,600 ,15;
1,4,600 ,16;
50,1,2000,17;
10,1,2000,18;
1,1,2000,19;
50,2,2000,20;
10,3,2000,21;
1,3,2000,22;
10,4,2000,23;
1,4,2000,24;];
% 3 Determination of transmitting/base antenna height, h1
if strcmp(path,'Warm')||strcmp(path,'Cold')||strcmp(path,'Sea')
generalPath = 'Sea';
idx = figure(:,2)>1;
figure = figure(idx,:);
else
generalPath = 'Land';
idx = (figure(:,2)==1);
figure = figure(idx,:);
end
h1 = h1Calc(d,heff,ha,hb,generalPath);
if h1 > 3000
h1 = 3000;
warning('h1 was larger than 3000m set value to 3000');
end
if isnan(h1)
error('h1 is nan');
end
if isempty(h1)
error('h1 is empty');
end
% 2 Maximum field-strength values
Emaxvalue = Emax(d,t,generalPath);
if isnan(Emaxvalue)
error('Emax is NaN');
end
% Step 1: Determine the type of the propagation path as land, cold sea or
% warm sea. If the path is mixed then determine two path types which are
% regarded as first and second propagation types. If the path can be
% represented by a single type then this is regarded as the first
% propagation type and the mixed-path method given in Step 11 is not
% required.
% Where,
% time is percentage 1%,10%,50%
% path is 1 = Land, 2 = Sea, 3 = Cold Sea, 4 = Warm Sea
% figure is excel figure number 1 - 24
% Step 2: For any given percentage of time (in the range 1% to 50% time)
% determine two nominal time percentages as follows:
% – wanted time percentage > 1 and < 10, the lower and higher nominal
% percentages are 1 and 10, respectively;
% – wanted time percentage > 10 and < 50, the lower and higher nominal
% percentages are 10 and 50, respectively.
% If the required percentage of time is equal to 1% or 10% or 50%, this
% value should be regarded as the lower nominal percentage time and the
% interpolation process of Step 10 is not required.
% done in start of step 6-10
% Step 3: For any wanted frequency (in the range 30 to 3 000 MHz) determine
% two nominal frequencies as follows:
% – where the wanted frequency < 600 MHz, the lower and higher nominal
% frequencies are 100 and 600 MHz, respectively;
% – where the wanted frequency > 600 MHz, the lower and higher nominal
% frequencies are 600 and 2 000 MHz, respectively.
% If the wanted frequency equals 100 or 600 or 2 000 MHz, this value should
% be regarded as the lower nominal frequency and the
% interpolation/extrapolation process of Step 9 is not required.
% done in start of step normal step 7-9
% Step 4: Determine the lower and higher nominal distances from Table 1
% closest to the required distance. If the required distance coincides with
% a value in Table 1, this should be regarded as the lower nominal distance
% and the interpolation process of Step 8.1.5 is not required.
[dinf, dsup] = FindDNominals(d);
% Step 5: For the first propagation type follow Steps 6 to 11.
% only one progression type at a time.
E = step6_10(figure,h1,dinf,dsup,d,path,f,Emaxvalue,t)-FS_offset;
% Step 11: If the prediction is for a mixed path, follow the step-by-step
% procedure given in Annex 5, § 8. This requires use of Steps 6 to 10 for
% paths of each propagation type. Note that if different sections of the
% path exist classified as both cold and warm sea, all sea sections should
% be classified as warm sea.
% not implemented
return
end