0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % MDC1 Conversion to acceleration
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % Test script for the MDC1 conversion to acceleration of IFO data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % $Id: test_ao_ltp_ifo2acc.m,v 1.6 2009/12/10 15:35:38 luigi Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 %% Clear
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 clear all
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 %% Loading data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 currPath = cd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 cd 'C:\Users\Luigi\Dati\mock_data\interferometer\';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 j=1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 fs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 disp(sprintf('*** Reading data %d', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 in = load(sprintf('mockdata_16_48_17_11_2007_%d.dat', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 d1 = in(:,2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 d12 = in(:,3);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 % Build O1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 eval('ts = tsdata(d1, fs);');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 eval(sprintf('o1_%d = ao(ts);', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 eval(sprintf('o1_%d = setName(o1_%d, ''o1'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 eval(sprintf('o1_%d = setXunits(o1_%d, ''s'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 eval(sprintf('o1_%d = setYunits(o1_%d, ''m'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 % Build O12
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 eval('ts = tsdata(d12, fs);');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 eval(sprintf('o12_%d = ao(ts);', j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 eval(sprintf('o12_%d = setName(o12_%d, ''o12'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 eval(sprintf('o12_%d = setXunits(o12_%d, ''s'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 eval(sprintf('o12_%d = setYunits(o12_%d, ''m'');', j, j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 cd(currPath)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 eval(sprintf('ch1 = o1_%d;',j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 eval(sprintf('ch2 = o12_%d;',j));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 %% Save
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 % save(ch1, 'C:\Dati\mock_data\interferometer\mdc1_ch1.mat')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 % save(ch2, 'C:\Dati\mock_data\interferometer\mdc1_ch12.mat')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 %% Check data spectra
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 ch1xx = ch1.psd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 ch2xx = ch2.psd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 iplot(ch1xx,ch2xx)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 %% Convert to acceleration
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 % default settings
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 [a1,ad] = ltp_ifo2acc(ch1,ch2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 %% check spectra
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 a1xx = a1.psd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 adxx = ad.psd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 iplot(a1xx,adxx)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 %% ************************************************************************
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 %% Set useful params
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 % corresponding to default values
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 fs = ch1.fs; % Hz - sampling frequency
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 TAU_th = 0.1; % s - time constant of thrusters actuation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 DELTAT_Th = 0.315; % s - delay introduced to command the force to thrusters system
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 TAU_el = 0.01; % s - time constant of electrostatic actuation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77 DELTAT_el = 0.305; % s - delay introduced to command the force to electrostatic actuators
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 w1 = 0.00114i; % TM1 stiffness
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 w2 = 0.00141i; % TM2 stiffness
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 S11 = 1; % Calibration of IFO CH1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 S1D = 0; % Cross-talk diff channel to channel 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 SD1 = -1e-4; % Cross-talk channel 1 to diff channel
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 SDD = 1; % Calibration of IFO diff channel
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 m1 = 1.96; % TM1 mass
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 m2 = 1.96; % TM2 mass
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 msc = 422.7; % SC mass
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 Gamma = 4.92e-9; % Gravitational gradient
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 %% Do step-by-step Checks
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 % get mdc1 ifo noise psd models
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 currPath = cd;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 cd 'C:\Users\Luigi\ltp_data_analysis\MDCs\MDC1_UTN\';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 So = matrix([cd '\CSD_mod.mat']);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 cd(currPath)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 % frequency range for TFs calculation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 f = So.objs(1,1).x;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 % set units for So
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 for ii=1:numel(So.objs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 So.objs(ii).setYunits('m^2 Hz^-1');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 %% Get intermediate steps
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 % get just Free Dynamics
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 [a1fd,adfd] = ltp_ifo2acc(ch1,ch2,plist('Hdf',0,'Hsus',0,'Adf',0,'Asus',0));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 % get actuated force per unit of mass
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 [a1c,adc] = ltp_ifo2acc(ch1,ch2,plist('FreeDyn_1',0,'FreeDyn_Delta',0));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 %% IFO TFs ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 % Getting models
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 IFO11 = smodel('S11');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 IFO11.setParams({'S11'},{S11});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 IFO11.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 IFO11.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129 IFO11.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 IFO11.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 IFO1D = smodel('S1D');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 IFO1D.setParams({'S1D'},{S1D});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 IFO1D.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 IFO1D.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 IFO1D.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 IFO1D.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 IFOD1 = smodel('SD1');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140 IFOD1.setParams({'SD1'},{SD1});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 IFOD1.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 IFOD1.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 IFOD1.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 IFOD1.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 IFODD = smodel('SDD');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147 IFODD.setParams({'SDD'},{SDD});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148 IFODD.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 IFODD.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150 IFODD.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 IFODD.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 % Build the matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 IFO = matrix([IFO11 IFO1D;IFOD1 IFODD]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 %% Free Dynamics TFs ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 % Getting models
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 FD11 = smodel('(2.*pi.*1i.*f).^2 + (1+m1/msc)*(w1^2) + (m2/msc)*(w2^2)');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 FD11.setParams({'m1','m2','msc','w1','w2'},{m1,m2,msc,w1,w2});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 FD11.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 FD11.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 FD11.setYunits('s^-2');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 FD11.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 FD11.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 FD12 = smodel('(m2/msc)*(w2^2) + Gamma');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 FD12.setParams({'m2','msc','w2','Gamma'},{m2,msc,w2,Gamma});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 FD12.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 FD12.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 FD12.setYunits('s^-2');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173 FD12.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 FD12.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 FD21 = smodel('(w2^2) - (w1^2)');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177 FD21.setParams({'w1','w2'},{w1,w2});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178 FD21.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 FD21.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180 FD21.setYunits('s^-2');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 FD21.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 FD21.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 FD22 = smodel('(2.*pi.*1i.*f).^2 + (w2^2) - 2*Gamma');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185 FD22.setParams({'w2','Gamma'},{w2,Gamma});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 FD22.setXvar('f');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 FD22.setXvals(f);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 FD22.setYunits('s^-2');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189 FD22.setXunits('Hz');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190 FD22.setName;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192 % Build the matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 FD = matrix([FD11 FD12;FD21 FD22]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 % Transfer function from IFO output --> total acceleration
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 FDO = FD*inv(IFO);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 FDO11 = eval(FDO.objs(1,1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 FDO12 = eval(FDO.objs(1,2));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200 FDO21 = eval(FDO.objs(2,1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 FDO22 = eval(FDO.objs(2,2));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 FDOe = matrix([FDO11 FDO12;FDO21 FDO22]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 % expected PSD for total acceleration
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206 Sfd = FDOe*So*conj(transpose(FDOe));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208 % eval results
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209 Sfd11 = (2/fs).*abs(Sfd.objs(1,1));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210 Sfd12 = (2/fs).*Sfd.objs(1,2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211 Sfd22 = (2/fs).*abs(Sfd.objs(2,2));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213 % get PSD from data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214 plpsd = plist('nfft',1e5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215 Pfd11 = psd(a1fd,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 Pfd22 = psd(adfd,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 % plcsd = plist('nfft',5e3);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 % Pfd12 = csd(a1fd,adfd,plcsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220 %% plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 plpl1 = plist('Legends', {'S_{a1a1} data','S_{a1a1}','S_{aDaD} data','S_{aDaD}'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 'LineStyles', {'', '--', '', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223 iplot(sqrt(Pfd11),sqrt(Sfd11),sqrt(Pfd22),sqrt(Sfd22),plpl1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224 % iplot(Pfd11,Sfd11,Pfd22,Sfd22,plpl1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226 % plpl2 = plist('Legends', {'S_{a1aD} data','S_{a1aD}'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227 % 'LineStyles', {'', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228 % iplot(Pfd12,Sfd12,plpl2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
230
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
231 %% Controllers TFs ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
232
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
233 % Get expected transfer functions
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
234 Cdf = miir(plist('built-in','DFACS_x_Hdf'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
235 Cdfr = resp(Cdf,plist('f',f,'bank','parallel'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
236
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
237 Csus = miir(plist('built-in','DFACS_M3_x_Hsus'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
238 Csusr = resp(Csus,plist('f',f,'bank','parallel'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
239
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
240 % Control matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
241 H = matrix([Cdfr ao(0);ao(0) Csusr]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
242
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
243 %% Actuation TFs ***
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
244 % Get expected transfer functions
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
245 % ThActr = ao(plist('fsfcn', '10.*(1./(1 + (2.*pi.*1i.*f)*0.1)).*(1./(2.*pi.*1i.*f)).*(exp(-(2.*pi.*1i.*f).*0.315)-exp(-(2.*pi.*1i.*f).*(0.315+0.1)))', 'f', f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
246 % ElActr = ao(plist('fsfcn', '10.*(1./(1 + (2.*pi.*1i.*f)*0.01)).*(1./(2.*pi.*1i.*f)).*(exp(-(2.*pi.*1i.*f).*0.305)-exp(-(2.*pi.*1i.*f).*(0.305+0.1)))', 'f', f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
247
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
248 % Get expected transfer functions
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
249 pl = plist('built-in','mdc1_Adf');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
250 Adf = miir(pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
251 Adfr = resp(Adf,plist('f',f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
252
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
253 pl = plist('built-in','mdc1_Asus');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
254 Asus = miir(pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
255 Asusr = resp(Asus,plist('f',f));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
256
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
257 % Actuation matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
258 A = matrix([Adfr ao(0);ao(0) Asusr]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
259
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
260 %% Get expected spectra and measured
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
261
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
262 C = matrix([ao(1) ao(-m2/msc);ao(0) ao(-1)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
263 Hnorm = matrix([ao(1/msc) ao(0);ao(0) ao(1/m2)]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
264 tfc = C*A*Hnorm*H;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
265 for ii =1:numel(tfc.objs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
266 tfc.objs(ii).setYunits(tfc.objs(ii).yunits/unit('kg'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
267 tfc.objs(ii).simplifyYunits;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
268 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
269 Sc = tfc*So*conj(transpose(tfc));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
270
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
271 % get PSD from data
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
272 plpsd = plist('nfft',1e5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
273 Pc11 = psd(a1c,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
274 Pc22 = psd(adc,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
275 % plcsd = plist('nfft',5e3);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
276 % Pc12 = csd(a1c,adc,plcsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
277
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
278 % plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
279 plpl1 = plist('Legends', {'S_{a1a1} data','S_{a1a1}','S_{aDaD} data','S_{aDaD}'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
280 'LineStyles', {'', '--', '', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
281 % iplot(Pc11,(2/fs).*abs(Sc.objs(1,1)),Pc22,(2/fs).*abs(Sc.objs(2,2)),plpl1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
282 iplot(sqrt(Pc11),sqrt((2/fs).*abs(Sc.objs(1,1))),sqrt(Pc22),sqrt((2/fs).*abs(Sc.objs(2,2))),plpl1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
283
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
284 % plpl2 = plist('Legends', {'S_{a1aD} data','S_{a1aD}'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
285 % 'LineStyles', {'', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
286 % iplot(Pc12,Sc.objs(1,2),plpl2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
287
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
288
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
289 %% Full model of acceleration noise
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
290
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
291 TF = FDOe + tfc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
292 Stot = TF*So*conj(transpose(TF));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
293
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
294 % plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
295 plpl = plist('Legends', {'Ch1 data','Ch1','Ch12 data','Ch12'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
296 'LineStyles', {'', '--', '', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
297 iplot(sqrt(a1xx),sqrt((2/fs).*abs(Stot.objs(1,1))),sqrt(adxx),sqrt((2/fs).*abs(Stot.objs(2,2))),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
298 % iplot(a1xx,(2/fs).*abs(Stot.objs(1,1)),adxx,(2/fs).*abs(Stot.objs(2,2)),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
299
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
300
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
301
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
302 %% Test with zero input
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
303
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
304 nsecs = ch1.nsecs;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
305
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
306 ch1_0 = ao(plist('tsfcn', 'zeros(size(t))', 'fs', 10, 'nsecs', nsecs, 'yunits','m'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
307 ch2_0 = ao(plist('tsfcn', 'zeros(size(t))', 'fs', 10, 'nsecs', nsecs, 'yunits','m'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
308
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
309 %% %%% %%% %%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
310
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
311 [a1_0,ad_0] = ltp_ifo2acc(ch1_0,ch2_0);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
312
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
313 % output must be zero
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
314 plpsd = plist('nfft',1e5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
315 a1_0xx = psd(a1_0,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
316 ad_0xx = psd(ad_0,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
317
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
318 % plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
319 plpl = plist('Legends', {'Ch1 data','Ch12 data'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
320 'LineStyles', {'', ''},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
321 iplot(sqrt(a1_0xx),sqrt(ad_0xx),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
322
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
323 %% %%% %%% %%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
324
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
325 [a1_1,ad_1] = ltp_ifo2acc(ch1,ch2_0);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
326
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
327 TF = FDOe + tfc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
328 So1 = copy(So,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
329 for ii = 2:numel(So1.objs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
330 So1.objs(ii).setY(zeros(size(So1.objs(ii).x)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
331 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
332 Stot1 = TF*So1*conj(transpose(TF));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
333
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
334 plpsd = plist('nfft',1e5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
335 a1_1xx = psd(a1_1,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
336 ad_1xx = psd(ad_1,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
337
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
338 % plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
339 plpl = plist('Legends', {'Ch1 data','Ch1','Ch12 data','Ch12'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
340 'LineStyles', {'', '--', '', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
341 iplot(sqrt(a1_1xx),sqrt((2/fs).*abs(Stot1.objs(1,1))),sqrt(ad_1xx),sqrt((2/fs).*abs(Stot1.objs(2,2))),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
342
|
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 [a1_2,ad_2] = ltp_ifo2acc(ch1_0,ch2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
346
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
347 TF = FDOe + tfc;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
348 So2 = copy(So,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
349 for ii = 1:numel(So2.objs)-1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
350 So2.objs(ii).setY(zeros(size(So2.objs(ii).x)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
351 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
352 Stot2 = TF*So2*conj(transpose(TF));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
353
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
354 plpsd = plist('nfft',1e5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
355 a1_2xx = psd(a1_2,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
356 ad_2xx = psd(ad_2,plpsd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
357
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
358 % plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
359 plpl = plist('Legends', {'Ch1 data','Ch1','Ch12 data','Ch12'},...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
360 'LineStyles', {'', '--', '', '--'},'LineWidths',{'All',3});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
361 iplot(sqrt(a1_2xx),sqrt((2/fs).*abs(Stot2.objs(1,1))),sqrt(ad_2xx),sqrt((2/fs).*abs(Stot2.objs(2,2))),plpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
362
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
363
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
364
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
365
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
366
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
367
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
368
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
369
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
370
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
371
|