-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathfind_nadir_center_using_spline_fit.m
53 lines (44 loc) · 1.27 KB
/
find_nadir_center_using_spline_fit.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
function nadir_center = find_nadir_center_using_spline_fit(accross_track_signal, varargin)
% A simple function to find the first returns using spline fitting
%
%
% Inputs-
% accross_track_signal: one ping (across-track)
% spline_tol: The spline tune parameter
%
%
%
% Author: Mohammed Al-Rawi, [email protected]
%
% Date: Oct 22, 2016
%
% Project SWARMs http://www.swarms.eu/
%
%
% License:
%=====================================================================
% This is part of the UNDROIP toolbox, released under
% the GPL. https://github.com/rawi707/UNDROIP/blob/master/LICENSE
%
% The UNDROIP toolbox is available free and
% unsupported to those who might find it useful. We do not
% take any responsibility whatsoever for any problems that
% you have related to the use of the UNDROIP toolbox.
%
% ======================================================================
%%
defaults.spline_tol = 1e-8;
args = propval(varargin, defaults);
f_size = length(accross_track_signal);
wL = csaps(1:f_size, log(accross_track_signal), args.spline_tol , 1:f_size); % plot(ys); hold on; plot(fmat)
%[~, nadir_center]= min(wL);
i=1;
while(1)
if wL(i+1)<wL(i)
i=i+1;
continue;
else break;
end
end
nadir_center= i;
end