Mercurial > hg > ltpda
comparison m-toolbox/test/test_ao_filtSubtract.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 ao/filtSubtract | |
2 % | |
3 % M Nofrarias 14-05-09 | |
4 % | |
5 % $Id: test_ao_filtSubtract.m,v 1.1 2009/08/06 09:12:12 miquel Exp $ | |
6 % | |
7 | |
8 %% Make test AOs | |
9 | |
10 % clear | |
11 | |
12 nsecs = 1000; | |
13 fs = 10; | |
14 | |
15 | |
16 pl1 = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))'); | |
17 a1 = ao(pl1); | |
18 | |
19 | |
20 pl2 = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*0.01*t)'); | |
21 a2 = ao(pl2); | |
22 | |
23 % linear coupling | |
24 a3 = a1 + a2 | |
25 a3.setName('input') | |
26 | |
27 %% Filter Subtraction | |
28 | |
29 w = specwin('Kaiser', 100, 90); | |
30 % plist lcohere | |
31 pll = plist(... | |
32 'type','ms',... | |
33 'Kdes', 100,... | |
34 'win',w,... | |
35 'Jdes', 200,... | |
36 'Order', 1,... | |
37 'variance','no'); | |
38 | |
39 % plist zDomainFit fit | |
40 plf = plist('fs',fs,... | |
41 'AutoSearch','on',... | |
42 'StartPoles',[],... | |
43 'StartPolesOpt','real',... | |
44 'maxiter',500,... | |
45 'minorder',3,... | |
46 'maxorder',4,... | |
47 'FITTOL',1e-8,... | |
48 'MSEVARTOL',1e-8,... | |
49 'Plot','off',... | |
50 'ForceStability','on',... | |
51 'direct term','off',... | |
52 'CheckProgress','off'); | |
53 | |
54 % plist split | |
55 plb = plist('times',[10 1000],... | |
56 'filtspl',[0.1 5]); | |
57 | |
58 a4 = filtSubtract(a3,a1,pll,plf,plb); | |
59 | |
60 | |
61 %% Plot | |
62 | |
63 iplot(a1,a3) | |
64 | |
65 iplot(a4) | |
66 | |
67 %% Test Subtraction | |
68 | |
69 b = lpsd(a3,a4) | |
70 b.iplot | |
71 | |
72 %% History | |
73 | |
74 plot(a4.hist) | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 |