comparison m-toolbox/test/test_ao_zDomainFit_2.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % Test script for zDomainFit in two dimensional case
2 %
3 % L. Ferraioli 02-12-08
4 %
5 % $Id: test_ao_zDomainFit_2.m,v 1.5 2009/12/02 16:50:49 luigi Exp $
6 %
7 %% Building a frequency response
8
9 % Create a frequency-series AO
10 pl_data1 = plist('fsfcn', '(1e-3./(f).^2 + 1e3./(0.001+f) + 1e5.*f.^2).*1e-10', 'f1', 1e-6, 'f2', 5, 'nf', 100);
11 a1 = ao(pl_data1);
12 a1.setName;
13
14 pl_data2 = plist('fsfcn', '(5e-3./(2e-5+f).^2 + 5e3./(0.001+f) + 5e4.*f.^2).*1e-10', 'f1', 1e-6, 'f2', 5, 'nf', 100);
15 a2 = ao(pl_data2);
16 a2.setName;
17
18 iplot(a1,a2)
19 a = [a1,a2];
20
21 %% Fitting
22
23 % Fitting parameter list
24 pl_fit = plist('FS',10,...
25 'AutoSearch','on',...
26 'StartPoles',[],...
27 'StartPolesOpt','clog',...
28 'maxiter',60,...
29 'minorder',15,...
30 'maxorder',35,...
31 'weights',[],...
32 'weightparam','abs',...
33 'CONDTYPE','MSE',...
34 'FITTOL',1e-4,... % check if MSE is lower than 1e-4
35 'MSEVARTOL',1e-2,...
36 'Plot','off',...
37 'ForceStability','off',...
38 'CheckProgress','off');
39
40 % Do fit
41 mod = zDomainFit(a, pl_fit);
42
43 %% Comparison
44 resp(2,1) = ao;
45 resids(2,1) = ao;
46 mse(2,1) = ao;
47
48 for ii = 1:numel(mod.objs)
49 resp(ii) = mod.objs(ii).procinfo.find('FIT_RESP');
50 resids(ii) = mod.objs(ii).procinfo.find('FIT_RESIDUALS');
51 mse(ii) = mod.objs(ii).procinfo.find('FIT_MSE');
52 end
53
54 iplot(a,resp,abs(resids))
55