Mercurial > hg > ltpda
comparison m-toolbox/test/test_ao_sDomainFit_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 sDomainFit in two dimensional case | |
2 % | |
3 % L. Ferraioli 02-12-08 | |
4 % | |
5 % $Id: test_ao_sDomainFit_2.m,v 1.4 2009/08/06 21:55:34 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', 1000); | |
11 a1 = ao(pl_data1); | |
12 | |
13 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', 1000); | |
14 a2 = ao(pl_data2); | |
15 | |
16 iplot(a1,a2) | |
17 a = [a1,a2]; | |
18 | |
19 %% Fitting | |
20 | |
21 % Fitting parameter list | |
22 pl_fit = plist('AutoSearch','on',... | |
23 'StartPoles',[],... | |
24 'StartPolesOpt','clog',... | |
25 'maxiter',35,... | |
26 'minorder',10,... | |
27 'maxorder',25,... | |
28 'weights',[],... | |
29 'weightparam','abs',... | |
30 'CONDTYPE','MSE',... | |
31 'FITTOL',1e-3,... | |
32 'MSEVARTOL',1e-2,... | |
33 'Plot','off',... | |
34 'ForceStability','off',... | |
35 'direct term','off',... | |
36 'CheckProgress','off'); | |
37 | |
38 % Do fit | |
39 mod = sDomainFit(a, pl_fit); | |
40 | |
41 %% Comparison | |
42 | |
43 resp(2,1) = ao; | |
44 resids(2,1) = ao; | |
45 mse(2,1) = ao; | |
46 | |
47 for ii = 1:numel(mod.objs) | |
48 resp(ii) = mod.objs(ii).procinfo.find('FIT_RESP'); | |
49 resids(ii) = mod.objs(ii).procinfo.find('FIT_RESIDUALS'); | |
50 mse(ii) = mod.objs(ii).procinfo.find('FIT_MSE'); | |
51 end | |
52 | |
53 iplot(a,resp,abs(resids)) | |
54 iplot(mse,plist('Yscales',{'All','log'})) | |
55 |