0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % zDomainFit performs a fitting loop to identify model order and
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % parameters.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % DESCRIPTION: zDomainFit fit a partial fraction model to frequency
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % response data using the function utils.math.vdfit.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 % The function performs a fitting loop to automatically identify model
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 % order and parameters in z-domain. Output is a z-domain model expanded
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 % in partial fractions:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 % z*r1 z*rN
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 % f(s) = ------- + ... + -------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 % z - p1 z - pN
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 % The identification loop stop when the stop condition is reached.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 % Output poles and residues are those with minimum Mean Square Error.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 % The stop criterion is based on three different approaches, that can be
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 % chosen by setting the value of the CONDTYPE parameter:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 % 1) Mean Squared Error and variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 % (CONDTYPE = 'MSE')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 % Check if the normalized mean squared error is lower than the value specified in
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 % the parameter FITTOL and if the relative variation of the mean squared error
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 % is lower than the value specified in the parameter MSEVARTOL.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 % E.g. FITTOL = 1e-3, MSEVARTOL = 1e-2 will search for a fit with
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 % normalized magnitude error lower than 1e-3 and MSE relative
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 % variation lower than 1e-2.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 % 2) Residuals Log difference and mean squared error variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 % (CONDTYPE = 'RLD')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 % Log Residuals difference
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 % Check if the minimum of the logarithmic difference between data and
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 % residuals is larger than a specified value.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 % E.g. if the tolerance value is set to 2 (FITTOL = 2), the function
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 % ensures that the difference between data and residuals is at lest 2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 % orders of magnitude lower than data itselves.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 % Mean Squared Error Variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 % Check if the relative variation of the mean squared error is lower than
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 % MSEVARTOL.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 % 3) Residuals spectral flatness and mean squared error variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 % (CONDTYPE = 'RSF')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 % Residuals Spectral Flatness
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 % In case of a fit on noisy data, the residuals from a good fit are
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 % expected to be as much as possible similar to a white noise. This
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 % property can be used to test the accuracy of a fit procedure. In
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 % particular it can be tested that the spectral flatness coefficient of
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 % the residuals is larger than a certain quantity sf such that 0<sf<1.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 % E.g. if the tolerance value is set to 0.2 (FITTOL = 0.2), the function
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 % ensures that the spectral flatness coefficient of the residuals is
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 % larger than 0.2.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 % Root Mean Squared Error
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 % Check if the relative variation of the mean squared error is lower than
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 % MSEVARTOL.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 % Both in the first, second and third approaches the fitting loop ends
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 % when the two stopping conditions are satisfied.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 % The function can also perform a single loop without taking care of
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 % the stop conditions. This happens when the 'AUTOSEARCH' parameter is
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 % set to 'off'.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 % If you provide more than one AO as input, they will be fitted
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 % together with a common set of poles.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 % CALL: mod = zDomainFit(a, pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 % INPUTS: a - input AOs to fit to. If you provide more than one AO as
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 % input, they will be fitted together with a common set
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 % of poles. Only frequency domain (fsdata) data can be
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 % fitted. Each non-fsdata object will be ignored. Input
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 % objects must have the same number of elements.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 % pl - parameter list (see below)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 % OUTPUTS:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 % mod - matrix object containing filterbanks of
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 % parallel miir filters for each input AO.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 % Useful fit information are stored in the objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 % procinfo:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 % FIT_RESP - model frequency response.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 % FIT_RESIDUALS - analysis object containing the fit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 % residuals.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 % FIT_MSE - analysis object containing the mean squared
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 % error progression during the fitting loop.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 % <a href="matlab:utils.helper.displayMethodInfo('ao', 'zDomainFit')">Parameters Description</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 % Note: all the input objects are assumed to caontain the same X
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 % (frequencies) values
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 % EXAMPLES:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 % 1) Fit to a frequency-series using the 'MSE' conditioning criterion for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 % fit accuracy
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 % % Create a frequency-series AO
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 % pl_data = plist('fsfcn', '0.01./(0.0001+f)', 'f1', 1e-5, 'f2', 5, 'nf', 1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 % a = ao(pl_data);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 % % Fitting parameter list
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 % pl_fit = plist('FS',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 % 'AutoSearch','on',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 % 'StartPoles',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 % 'StartPolesOpt','clog',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 % 'maxiter',5,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 % 'minorder',2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 % 'maxorder',20,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 % 'weights',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 % 'weightparam','abs',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 % 'CONDTYPE','MSE',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 % 'FITTOL',1e-3,... % check if MSE is lower than 1e-3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 % 'MSEVARTOL',1e-2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 % 'Plot','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 % 'ForceStability','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 % 'CheckProgress','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 % % Do fit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 % b = zDomainFit(a, pl_fit);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 % 2) Fit to a frequency-series using the 'RLD' conditioning criterion for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 % fit accuracy
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 % % Create a frequency-series AO
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 % pl_data = plist('fsfcn', '0.01./(0.0001+f)', 'f1', 1e-5, 'f2', 5, 'nf', 1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129 % a = ao(pl_data);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 % % Fitting parameter list
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 % pl_fit = plist('FS',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 % 'AutoSearch','on',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 % 'StartPoles',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 % 'StartPolesOpt','clog',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 % 'maxiter',5,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 % 'minorder',2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 % 'maxorder',20,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 % 'weights',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140 % 'weightparam','abs',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 % 'CONDTYPE','RLD',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 % 'FITTOL',2,... % check if log10(abs(data))-log10(abs(fit_residuals)) > 2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 % 'MSEVARTOL',1e-2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 % 'Plot','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 % 'ForceStability','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 % 'CheckProgress','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148 % % Do fit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 % b = zDomainFit(a, pl_fit);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 % 3) Fit to a frequency-series using the 'RSF' conditioning criterion for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 % fit accuracy
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 % % Create a frequency-series AO
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 % pl_data = plist('fsfcn', '0.01./(0.0001+f)', 'f1', 1e-5, 'f2', 5, 'nf', 1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 % a = ao(pl_data);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 % % Fitting parameter list
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 % pl_fit = plist('FS',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 % 'AutoSearch','on',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 % 'StartPoles',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 % 'StartPolesOpt','clog',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 % 'maxiter',5,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 % 'minorder',2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 % 'maxorder',20,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 % 'weights',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167 % 'weightparam','abs',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 % 'CONDTYPE','RSF',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 % 'FITTOL',0.7,... % check if residuals spectral flatness is larger than 0.7
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 % 'MSEVARTOL',1e-2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 % 'Plot','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 % 'ForceStability','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173 % 'CheckProgress','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 % % Do fit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 % b = zDomainFit(a, pl_fit);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178 % VERSION: $Id: zDomainFit.m,v 1.39 2011/08/15 09:46:44 hewitson Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 function varargout = zDomainFit(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 % Check if this is a call for parameters
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185 if utils.helper.isinfocall(varargin{:})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 varargout{1} = getInfo(varargin{3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 return
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190 import utils.const.*
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 utils.helper.msg(msg.PROC3, 'running %s/%s', mfilename('class'), mfilename);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 % Collect input variable names
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194 in_names = cell(size(varargin));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 for ii = 1:nargin,in_names{ii} = inputname(ii);end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 % Collect all AOs and plists
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 pl = utils.helper.collect_objects(varargin(:), 'plist', in_names);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 %%% Decide on a deep copy or a modify
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 bs = copy(as, nargout);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 inhists = [as.hist];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 % combine plists
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206 pl = parse(pl, getDefaultPlist());
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208 if nargout == 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209 error('### zDomainFit cannot be used as a modifier. Please give an output variable.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212 %%%%% Extract necessary parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214 extpoles = find(pl, 'StartPoles'); % Check if external poles are providied
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215 spolesopt = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 if isempty(extpoles) % if no external poles set them internally
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 splopt = find(pl, 'StartPolesOpt');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 switch lower(splopt)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219 case 'real'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220 spolesopt = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 case 'clog'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 spolesopt = 2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223 case 'clin'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224 spolesopt = 3;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226 error('### Unknown value for parameter ''StartPolesOpt''');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
230 maxiter = find(pl, 'maxiter'); % set the maximum number of iterations
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
231 minorder = find(pl, 'minorder'); % set the minimum function order
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
232 maxorder = find(pl, 'maxorder');% set the maximum function order
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
233
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
234 extweights = find(pl, 'weights'); % check if external weights are provided
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
235 if isa(extweights, 'ao')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
236 extweights = extweights.y;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
237 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
238 weightparam = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
239 if isempty(extweights) % set internally the weights on the basis of the input options
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
240 wtparam = find(pl, 'weightparam');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
241 switch lower(wtparam)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
242 case 'ones'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
243 weightparam = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
244 case 'abs'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
245 weightparam = 2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
246 case 'sqrt'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
247 weightparam = 3;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
248 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
249 error('### Unknown value for parameter ''weightparam''');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
250 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
251 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
252
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
253 % decide to plot or not
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
254 plt = find(pl, 'plot');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
255 switch lower(plt)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
256 case 'on'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
257 showplot = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
258 case 'off'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
259 showplot = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
260 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
261 error('### Unknown value for parameter ''plot''');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
262 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
263
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
264 % Make a decision between Fit conditioning type
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
265 condtype = find(pl, 'CONDTYPE');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
266 condtype = upper(condtype);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
267 switch condtype
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
268 case 'MSE'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
269 ctp = 'chivar'; % use normalized mean squared error value and relative variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
270 lrscond = find(pl, 'FITTOL');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
271 % give an error for strange values of lrscond
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
272 if lrscond<0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
273 error('!!! Negative values for FITTOL are not allowed !!!')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
274 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
275 % handling data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
276 lrscond = -1*log10(lrscond);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
277 % give a warning for strange values of lrscond
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
278 if lrscond<0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
279 warning('You are searching for a MSE lower than %s', num2str(10^(-1*lrscond)))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
280 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
281 case 'RLD'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
282 ctp = 'lrsmse'; % use residuals log difference and MSE relative variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
283 lrscond = find(pl, 'FITTOL');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
284 % give a warning for strange values of lrscond
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
285 if lrscond<0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
286 error('!!! Negative values for FITTOL are not allowed !!!')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
287 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
288 if lrscond<1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
289 warning('You are searching for a frequency by frequency residuals log difference of %s', num2str(lrscond))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
290 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
291 case 'RSF'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
292 ctp = 'rftmse'; % use residuals spectral flatness and MSE relative variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
293 lrscond = find(pl, 'FITTOL');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
294 % give a warning for strange values of lrscond
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
295 if lrscond<0 || lrscond>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
296 error('!!! Values <0 or >1 for FITTOL are not allowed when CONDTYPE is RSF !!!')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
297 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
298 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
299 error('### Unknown value for parameter ''CONDTYPE''');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
300 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
301
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
302 % Tolerance for the MSE relative variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
303 msevar = find(pl, 'MSEVARTOL');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
304 % handling data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
305 msevar = -1*log10(msevar);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
306 % give a warning for strange values of msevar
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
307 if msevar<0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
308 warning('You are searching for MSE relative variation lower than %s', num2str(10^(-1*msevar)))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
309 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
310
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
311 % decide to stabilize or not the model
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
312 stab = find(pl, 'ForceStability');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
313 switch lower(stab)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
314 case 'on'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
315 stabfit = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
316 case 'off'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
317 stabfit = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
318 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
319 error('### Unknown value for parameter ''ForceStability''');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
320 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
321
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
322 % decide to disp or not the fitting progress in matlab command window
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
323 prg = find(pl, 'CheckProgress');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
324 switch lower(prg)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
325 case 'on'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
326 spy = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
327 case 'off'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
328 spy = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
329 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
330
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
331 % decide to perform or not a full automatic model search
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
332 autos = find(pl, 'AutoSearch');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
333 switch lower(autos)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
334 case 'on'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
335 fullauto = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
336 case 'off'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
337 fullauto = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
338 otherwise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
339 error('### Unknown value for parameter ''AutoSearch''');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
340 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
341
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
342 %%%%% End Extract necessary parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
343
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
344
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
345
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
346 %%%%% Fitting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
347
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
348 %%% Fit parameters
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
349 params = struct('spolesopt',spolesopt,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
350 'extpoles', extpoles,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
351 'Nmaxiter',maxiter,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
352 'minorder',minorder,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
353 'maxorder',maxorder,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
354 'weightparam',weightparam,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
355 'extweights', extweights,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
356 'plot',showplot,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
357 'ctp',ctp,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
358 'lrscond',lrscond,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
359 'msevar',msevar,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
360 'stabfit',stabfit,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
361 'dterm',0,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
362 'spy',spy,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
363 'fullauto',fullauto);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
364
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
365 %%% extracting elements from AOs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
366
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
367 % Finding the index of the first fsdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
368 for gg = 1:numel(bs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
369 if isa(bs(gg).data, 'fsdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
370 prm = gg;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
371 break
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
372 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
373 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
374
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
375 fs = find(pl, 'FS');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
376 if isempty(fs) && isnan(bs(prm).data.fs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
377 fs = max(bs(prm).data.x)*2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
378 elseif isempty(fs) && ~isnan(bs(prm).data.fs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
379 fs = bs(prm).data.fs;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
380 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
381
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
382 y = zeros(length(bs(prm).data.getY),numel(bs)); % initialize input vector
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
383 k = numel(bs(prm).data.getY); % setting a comparison constant
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
384 idx = true(numel(bs),1); % initialize the control index
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
385 for jj=1:numel(bs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
386 % checking that AOs are fsdata and skipping non fsdata objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
387 if ~isa(bs(jj).data, 'fsdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
388 % skipping data if non fsdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
389 warning('!!! %s expects ao/fsdata objects. Skipping AO %s', mfilename, ao_invars{jj});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
390 idx(jj) = false; % set the corresponding value of the control index to false
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
391 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
392 % preparing data for fit
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
393 yt = bs(jj).data.getY;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
394 if numel(yt)~=k
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
395 error('Input AOs must have the same number of elements')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
396 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
397 if size(yt,2)>1 % wish to work with columns
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
398 y(:,jj) = yt.';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
399 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
400 y(:,jj) = yt;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
401 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
402 if fs < max(bs(jj).data.x)*2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
403 warning('!!! %s cannot fit data when max(f) > fs/2 ', mfilename);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
404 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
405 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
406 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
407 % reshaping y to contain only Y from fsdata
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
408 y = y(:,idx);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
409
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
410 %%% extracting frequencies
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
411 % Note: all the objects are assumed to caontain the same X (frequencies) values
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
412 f = bs(prm).data.getX;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
413
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
414 %%% Fitting loop
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
415 [res,poles,dterm,mresp,rdl,mse] = utils.math.autodfit(y,f,fs,params);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
416
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
417 %%%%% End Fitting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
418
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
419
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
420
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
421 %%%%% Building output AOs with model responses, model parameters are
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
422 % added in the procinfo as parallel bank of miir objects %%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
423
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
424 % [a,b] = size(mresp);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
425 for kk = 1:numel(bs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
426 if idx(kk) % build outputs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
427
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
428 % Constructing a vector of miir objects
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
429 % pfilts = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
430 for hh=1:length(res(:,kk))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
431 mod(hh,kk) = miir(res(hh,kk), [ 1 -poles(hh)], fs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
432 % mod(hh,kk).addHistory(getInfo('None'), pl, [ao_invars(:)], [inhists(:)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
433 mod(hh,kk).setName(sprintf('fit(%s)', ao_invars{kk}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
434 % pfilts = [pfilts ft];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
435 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
436
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
437 bmod(kk) = filterbank(plist('filters',mod(:,kk),'type','parallel'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
438
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
439 bmod(kk).setName(sprintf('fit(%s)', ao_invars{kk}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
440
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
441 % bmod(kk).addHistory(getInfo('None'), pl, ao_invars(kk), inhist);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
442
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
443
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
444
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
445 % Output also, model response, residuals and mse in the procinfo
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
446 rsp = mresp(:,kk);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
447 bs(kk).data.setY(rsp);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
448 bs(kk).setFs(fs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
449 % clear errors
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
450 bs(kk).clearErrors;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
451
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
452 % Set output AO name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
453 bs(kk).setName(sprintf('fit_resp(%s)', ao_invars{kk}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
454 % Add history
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
455 % bs(kk).addHistory(getInfo('None'), pl, [ao_invars(:)], [inhists(:)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
456
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
457 res_ao = copy(bs(kk),1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
458 trdl = rdl(:,kk);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
459 res_ao.data.setY(trdl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
460 res_ao.setFs(fs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
461
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
462 % Set output AO name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
463 res_ao.setName(sprintf('fit_residuals(%s)', ao_invars{kk}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
464 % Add history
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
465 % res_ao(kk).addHistory(getInfo('None'), pl, [ao_invars(:)], [inhists(:)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
466
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
467 d = cdata();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
468 tmse = mse(:,kk);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
469 d.setY(tmse);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
470 mse_ao = ao(d);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
471
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
472 % Set output AO name
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
473 mse_ao.setName(sprintf('fit_mse(%s)', ao_invars{kk}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
474
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
475 procpl = plist('fit_resp',bs(kk),...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
476 'fit_residuals',res_ao,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
477 'fit_mse',mse_ao);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
478
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
479 bmod(kk).setProcinfo(procpl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
480
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
481 else % in case of non fsdata input
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
482 bmod(kk) = filterbank(mirr());
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
483
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
484 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
485
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
486 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
487
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
488 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
489
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
490 %%%%%% Set outputs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
491 % Set output
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
492 if nargout == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
493 if numel(bs)==1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
494 bmod.setName(sprintf('fit(%s)', ao_invars{:}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
495 bmod.addHistory(getInfo('None'), pl, [ao_invars(:)], [inhists(:)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
496 varargout{1} = bmod;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
497 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
498 mmod = matrix(bmod);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
499 mmod.setName(sprintf('fit(%s)', ao_invars{:}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
500 mmod.addHistory(getInfo('None'), pl, [ao_invars(:)], [inhists(:)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
501 varargout{1} = mmod;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
502 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
503 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
504 % multiple output is not supported
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
505 error('### Multiple output is not supported ###')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
506 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
507
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
508
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
509 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
510
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
511 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
512
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
513 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
514 % Get Info Object
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
515 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
516 function ii = getInfo(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
517 if nargin == 1 && strcmpi(varargin{1}, 'None')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
518 sets = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
519 pl = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
520 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
521 sets = {'Default'};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
522 pl = getDefaultPlist;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
523 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
524 % Build info object
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
525 ii = minfo(mfilename, 'ao', 'ltpda', utils.const.categories.sigproc, '$Id: zDomainFit.m,v 1.39 2011/08/15 09:46:44 hewitson Exp $', sets, pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
526 ii.setModifier(false);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
527 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
528
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
529 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
530 % Get Default Plist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
531 %--------------------------------------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
532 function plout = getDefaultPlist()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
533 persistent pl;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
534 if exist('pl', 'var')==0 || isempty(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
535 pl = buildplist();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
536 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
537 plout = pl;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
538 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
539
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
540 function pl = buildplist()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
541 pl = plist();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
542
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
543 % AutoSearch
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
544 p = param({'AutoSearch', ['''on'': Parform a full automatic search for the<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
545 'transfer function order. The fitting<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
546 'procedure will stop when stop conditions<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
547 'defined are satisfied.<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
548 '''off'': Perform a fitting loop as long as the<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
549 'number of iteration reach ''maxiter''. The order<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
550 'of the fitting function will be that<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
551 'specified in ''MINORDER''.']}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
552 {1, {'on', 'off'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
553 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
554
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
555 % StartPoles
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
556 p = param({'StartPoles', ['A vector of starting poles. Providing a fixed<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
557 'set of starting poles fixes the function<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
558 'order. If it is left empty starting poles are<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
559 'internally assigned.']}, paramValue.EMPTY_DOUBLE);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
560 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
561
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
562 % StartPolesOpt
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
563 p = param({'StartPolesOpt', ['Define the characteristics of internally<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
564 'assigned starting poles. Admitted values<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
565 'are:<ul>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
566 '<li>''real'' linear-spaced real poles</li>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
567 '<li>''clog'' log-spaced complex poles</li>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
568 '<li>''clin'' linear-spaced complex poles</li></ul>']}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
569 {2, {'real', 'clog', 'clin'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
570 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
571
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
572 % MaxIter
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
573 p = param({'MaxIter', 'Maximum number of iterations in fit routine.'}, paramValue.DOUBLE_VALUE(50));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
574 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
575
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
576 % MinOrder
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
577 p = param({'MinOrder', 'Minimum order to fit with.'}, paramValue.DOUBLE_VALUE(2));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
578 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
579
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
580 % MaxOrder
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
581 p = param({'MaxOrder', 'Maximum order to fit with.'}, paramValue.DOUBLE_VALUE(20));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
582 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
583
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
584 % Weights
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
585 p = param({'Weights', ['A vector with the desired weights. If a single<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
586 'Ao is input weights must be a Nx1 vector where<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
587 'N is the number of elements in the input Ao. If<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
588 'M Aos are passed as input, then weights must<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
589 'be a NxM matrix. If it is leaved empty weights<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
590 'are internally assigned basing on the input<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
591 'parameters']}, paramValue.EMPTY_DOUBLE);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
592 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
593
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
594 % Weightparam
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
595 p = param({'weightparam', ['Specify the characteristics of the internally<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
596 'assigned weights. Admitted values are:<ul>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
597 '<li>''ones'' assigns weights equal to 1 to all data.</li>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
598 '<li>''abs'' weighs data with <tt>1./abs(y)</tt></li>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
599 '<li>''sqrt'' weighs data with <tt>1./sqrt(abs(y))</tt></li>']}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
600 {2, {'ones', 'abs', 'sqrt'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
601 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
602
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
603 % CONDTYPE
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
604 p = param({'CONDTYPE', ['Fit conditioning type. Admitted values are:<ul>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
605 '<li>''MSE'' Mean Squared Error and variation</li>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
606 '<li>''RLD'' Log residuals difference and mean squared error variation</li>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
607 '<li>''RSF'' Residuals spectral flatness and mean squared error variation</li></ul>']}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
608 {1, {'MSE', 'RLD', 'RSF'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
609 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
610
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
611 % FITTOL
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
612 p = param({'FITTOL', 'Fit tolerance.'}, paramValue.DOUBLE_VALUE(1e-3));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
613 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
614
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
615 % MSEVARTOL
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
616 p = param({'MSEVARTOL', ['Mean Squared Error Variation - Check if the<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
617 'relative variation of the mean squared error is<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
618 'smaller than the value specified. This<br>'...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
619 'option is useful for finding the minimum of the Chi-squared.']}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
620 paramValue.DOUBLE_VALUE(1e-2));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
621 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
622
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
623 % Plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
624 p = param({'Plot', 'Plot results of each fitting step.'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
625 {2, {'on', 'off'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
626 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
627
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
628 % ForceStability
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
629 p = param({'ForceStability', 'Force poles to be stable'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
630 {2, {'on', 'off'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
631 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
632
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
633 % CheckProgress
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
634 p = param({'CheckProgress', 'Display the status of the fit iteration.'}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
635 {2, {'on', 'off'}, paramValue.SINGLE});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
636 pl.append(p);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
637
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
638 % pl = plist('FS',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
639 % 'AutoSearch','on',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
640 % 'StartPoles',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
641 % 'StartPolesOpt','clog',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
642 % 'maxiter',50,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
643 % 'minorder',2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
644 % 'maxorder',20,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
645 % 'weights',[],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
646 % 'weightparam','abs',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
647 % 'CONDTYPE','MSE',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
648 % 'FITTOL',1e-3,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
649 % 'MSEVARTOL',1e-2,...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
650 % 'Plot','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
651 % 'ForceStability','off',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
652 % 'CheckProgress','off');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
653 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
654 % END
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
655
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
656
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
657 % PARAMETERS:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
658 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
659 % 'FS' - It is the sampling frequency. If it is left
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
660 % empty sampling frequency is searched in the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
661 % input AOs or is is calculated as 2 of the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
662 % maximum frequency reported in AOs xvalues.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
663 % [Default []].
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
664 % 'AutoSearch' - 'on': Parform a full automatic search for the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
665 % transfer function order. The fitting
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
666 % procedure will stop when stop conditions are
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
667 % satisfied. [Default]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
668 % 'off': Perform a fitting loop as long as the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
669 % number of iteration reach 'maxiter'. The order
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
670 % of the fitting function will be that
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
671 % specified in 'minorder'.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
672 % 'StartPoles' - A vector of starting poles. Providing a fixed
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
673 % set of starting poles fixes the function
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
674 % order. If it is left empty starting poles are
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
675 % internally assigned. [Default []]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
676 % 'StartPolesOpt' - Define the characteristics of internally
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
677 % assigned starting poles. Admitted values
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
678 % are:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
679 % - 'real' linspaced real poles
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
680 % - 'c1' complex poles on unit circle. First
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
681 % method [Default]. See help of
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
682 % utils.math.startpoles for additional info
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
683 % - 'c2' complex poles on unit circle. second
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
684 % method. See help of utils.math.startpoles
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
685 % for additional info.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
686 % 'maxiter' - Maximum number of allowed iteration. [Deafult
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
687 % 50].
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
688 % [default: -inf for each parameter];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
689 % 'minorder' - Minimum model function order. [Default 2]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
690 % 'maxorder' - Maximum model function order. [Default 20]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
691 % 'weights' - A vector with the desired weights. If a single
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
692 % Ao is input weights must be a Nx1 vector where
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
693 % N is the number of elements in the input Ao. If
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
694 % M Aos are passed as input, then weights must
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
695 % be a NxM matrix. If it is leaved empty weights
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
696 % are internally assigned basing on the input
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
697 % parameters. [Default []]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
698 % 'weightparam' - Specify the characteristics of the internally
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
699 % assigned weights. Admitted values are:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
700 % 'ones' assigns weights equal to 1 to all data.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
701 % 'abs' weights data with 1./abs(y) [Default]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
702 % 'sqrt' weights data with 1./sqrt(abs(y))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
703 % 'CONDTYPE' - Fit conditioning type. Admitted values are:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
704 % - 'MSE' Mean Squared Error and variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
705 % [Default]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
706 % - 'RLD' Log residuals difference and mean
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
707 % squared error variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
708 % - 'RSF' Residuals spectral flatness and mean
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
709 % squared error variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
710 % 'FITTOL' - Fit tolerance [Default, 1e-3]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
711 % 'MSEVARTOL' - This allow to check if the relative variation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
712 % of mean squared error is lower than the value
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
713 % sepcified. [Default 1e-2]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
714 % 'Plot' - Plot fit result: 'on' or 'off' [default]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
715 % 'ForceStability' - Force poles to be stable, values are
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
716 % 'on' or 'off'. [Default 'off']
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
717 % 'CheckProgress' - Disply the status of the fit iteration.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
718 % Values are 'on and 'off'. [Default 'off']
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
719 %
|