comparison m-toolbox/test/test_ao_dispersion.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 % A test script for ao/dispersion
2 %
3 % M Nofrarias 07-05-09
4 %
5 % $Id: test_ao_dispersion.m,v 1.2 2009/05/08 13:15:36 miquel Exp $
6 %
7
8 function test_ao_dispersion()
9
10 fs =10;
11 f = logspace(-5,log10(fs/2),100)';
12
13 %% nominal plist
14 pl = plist( 'f', f,...
15 'fs', fs,...
16 'wp1',0.0010488*1i,... % sqrt(-11e-7)
17 'wp2',0.0014832*1i,... % sqrt(-22e-7)
18 'Cdf',0.8,...
19 'Clfs',1.15,...
20 'dS',1.35e-4,...
21 'p_ifo1',[3.6e-12 10e-3 4.2 1.8e-3 8],...
22 'p_tm1',[7e-15 5e-3 3 4e-4 9],...
23 'p_ifo2', [3.6e-12 10e-3 4.2 1.8e-3 8],...
24 'p_tm2', [7e-15 5e-3 3 4e-4 9],...
25 'p_sc', [2.5e-10 12e-3 3.8 1e-3 8],...
26 'nsecs', 1e4,...
27 'fsgen', 50);
28
29 %% Compute transfer function
30
31 tf1 = ao(plist('built-in','mdc2r2_fd_ifo2ifo','index',1),pl);
32 % tf2 = ao(plist('built-in','mdc2r2_fd_ifo2ifo','index',3),pl);
33 % tf3 = ao(plist('built-in','mdc2r2_fd_ifo2ifo','index',4),pl);
34
35 % matched stiffness case
36 %
37 % plx = pset(pl,param('wp1',0.00154919*i)) % sqrt(-24e-7)
38 % plx = pset(plx,param('wp2',0.00154919*i)) % sqrt(-24e-7)
39 %
40 % tf1x = ao(plist('built-in','mdc2r2_fd_ifo2ifo','index',1),plx);
41 % tf2x = ao(plist('built-in','mdc2r2_fd_ifo2ifo','index',3),plx);
42 % tf3x = ao(plist('built-in','mdc2r2_fd_ifo2ifo','index',4),plx);
43
44
45 a = ao(fsdata(f,(f'.^2).*ones(1,length(f))));
46 a2 = ao(fsdata(f,(1./f'.^2).*ones(1,length(f))));
47
48 %% dispersion function
49
50 disp = dispersion(a,plist('model','mdc2r2','channel','i1o1'),pl);
51 disp2 = dispersion(a2,plist('model','mdc2r2','channel','i1o1'),pl);
52
53
54 %% plot
55
56 iplot(abs(tf1),disp,disp2)
57
58 %% compute transfer function error
59
60 noise_in = length(f)*fs/2*noise_param(f,7e-15,5e-3,3,4e-4,9)
61 noise_out = length(f)*fs/2*noise_param(f,3.6e-12,10e-3,4.2,1.8e-3,8)
62
63
64 varTF = disp.*(noise_in.*abs(tf1) + noise_out)
65 varTF.setName
66 varTF2 = disp2.*(noise_in.*abs(tf1) + noise_out)
67 varTF2.setName
68
69 % iplot(abs(tf1),plist('YErrU',sqrt(varTF)))
70 iplot(abs(tf1),sqrt(varTF),sqrt(varTF2))
71
72 end
73
74
75 %--------------------------------------------------------------------------
76 % Parametric function for noise contributions
77 %--------------------------------------------------------------------------
78
79 function o = noise_param(varargin)
80 f = varargin{1};
81 p1 = varargin{2};
82 p2 = varargin{3};
83 p3 = varargin{4};
84 p4 = varargin{5};
85 p5 = varargin{6};
86
87 % Description of the noise
88 fcn = p1^2*(1 + 1./(f./p2).^p3 + 1./(f./p4).^p5).^(1/2) ;
89
90 % Build AO from plist
91 o = ao(fsdata(f,fcn));
92
93
94 end