comparison m-toolbox/html_help/help/ug/ltpda_training_topic_3_6.html @ 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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta name="generator" content=
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
8 <meta http-equiv="Content-Type" content=
9 "text/html; charset=us-ascii">
10
11 <title>IFO/Temperature Example - Spectral Analysis (LTPDA Toolbox)</title>
12 <link rel="stylesheet" href="docstyle.css" type="text/css">
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
14 <meta name="description" content=
15 "Presents an overview of the features, system requirements, and starting the toolbox.">
16 </head>
17
18 <body>
19 <a name="top_of_page" id="top_of_page"></a>
20
21 <p style="font-size:1px;">&nbsp;</p>
22
23 <table class="nav" summary="Navigation aid" border="0" width=
24 "100%" cellpadding="0" cellspacing="0">
25 <tr>
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>
27
28 <td valign="baseline" align="right"><a href=
29 "ltpda_training_topic_3_5.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Empirical Transfer Function estimation"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "ltpda_training_topic_4.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Topic 4 - Transfer function models and digital filtering"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>IFO/Temperature Example - Spectral Analysis</h1>
37 <hr>
38
39 <p>
40
41 <h2>Loading the consolidated data sets from topic2</h2>
42 In the last topic you should have saved your consolidated data files as
43 <p>
44 <ul>
45 <li>ifo_temp_example/temp_fixed.xml</li>
46 <li>ifo_temp_example/ifo_fixed.xml</li>
47 </ul>
48 </p>
49
50 <p>
51 In order to proceed with the spectral analysis, we need to use the <tt>ao</tt> constuctor, with the
52 set of parameters "From XML File". The key
53 parameters are:
54 <table cellspacing="0" class="body" cellpadding="2" border="0" width="80%">
55 <colgroup>
56 <col width="15%"/>
57 <col width="35%"/>
58 <col width="50%"/>
59 </colgroup>
60 <thead>
61 <tr valign="top">
62 <th class="categorylist">Key</th>
63 <th class="categorylist">Value</th>
64 <th class="categorylist">Description</th>
65 </tr>
66 </thead>
67 <tbody>
68 <!-- Key 'filename' for IFO -->
69 <tr valign="top">
70 <td bgcolor="#f3f4f5">
71 <p><tt>FILENAME</tt></p>
72 </td>
73 <td bgcolor="#f3f4f5">
74 <p><span class="string">'ifo_temp_example/ifo_fixed.xml'</span></p>
75 </td>
76 <td bgcolor="#f3f4f5">
77 <p>The name of the file to read the data from.</p>
78 </td>
79 </tr>
80 <!-- Key 'filename' for T -->
81 <tr valign="top">
82 <td bgcolor="#f3f4f5">
83 <p><tt>FILENAME</tt></p>
84 </td>
85 <td bgcolor="#f3f4f5">
86 <p><span class="string">'ifo_temp_example/temp_fixed.xml'</span></p>
87 </td>
88 <td bgcolor="#f3f4f5">
89 <p>The name of the file to read the data from.</p>
90 </td>
91 </tr>
92 </tbody>
93 </table>
94 </p>
95 <p>Hint: the command-line sequence may be similar to the following:
96 <div class="fragment"><pre>
97 <span class="comment">%% Get the consolidated data</span>
98 <span class="comment">% Using the xml format</span>
99
100 T_filename = <span class="string">'ifo_temp_example/temp_fixed.xml'</span>;
101 x_filename = <span class="string">'ifo_temp_example/ifo_fixed.xml'</span>;
102
103 pl_load_T = plist(<span class="string">'filename'</span>, T_filename);
104 pl_load_x = plist(<span class="string">'filename'</span>, x_filename);
105
106 <span class="comment">% Build the data aos</span>
107 T = ao(pl_load_T);
108 x = ao(pl_load_x);
109 </pre></div>
110
111 </p>
112 <h2>Estimating the PSD of the signals</h2>
113
114 <p>
115 To perform the PSD estimation, you can use the method
116 <p>
117 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
118 <tr width="90%">
119 <td>
120 <tt>ao/lpsd</tt>
121 </td>
122 </tr>
123 </table>
124 </p>
125 <p>Hint: the command-line sequence may be similar to the following:
126 <div class="fragment"><pre>
127 <span class="comment">%% plists for spectral estimations</span>
128
129 <span class="comment">%% PSD</span>
130 x_psd = lpsd(x)
131 x_psd.setName(<span class="string">'Interferometer'</span>);
132
133 T_psd = lpsd(T)
134 T_psd.setName(<span class="string">'Temperature'</span>);
135
136 <span class="comment">% Plot estimated PSD</span>
137 pl_plot = plist(<span class="string">'Arrangement'</span>, <span class="string">'subplots'</span>, <span class="string">'LineStyles'</span>, {<span class="string">'-'</span>,<span class="string">'-'</span>},<span class="string">'Linecolors'</span>, {<span class="string">'b'</span>, <span class="string">'r'</span>});
138 iplot(sqrt(x_psd), sqrt(T_psd), pl_plot);
139 </pre></div>
140 </p>
141
142 <h2>Reducing time interval</h2>
143
144 <p>
145 Looking at the output of the analysis it is easy to recognize in the IFO PSD the signature of
146 some strong "spike" in the data. Indeed, if we plot the <tt>x</tt> data, we can find it
147 around <tt>t = 40800</tt>. There is also a leftover from the filtering process performed during
148 consolidation right near to the last data.
149 </p>
150 <p>
151 We can then try to estimate the impact of the "glitch" by comparing the results we obtain by
152 passing to <tt>ao/lpsd</tt> a reduced fraction of the data.
153 </p>
154
155 <p>
156 In order to select a fraction of the data we use the method:
157
158 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
159 <tr width="90%">
160 <td>
161 <tt>ao/split</tt>
162 </td>
163 </tr>
164 </table>
165 </p>
166 <p>
167 The relevant parameters for this method are listed here, together with their recommended values:
168 </p>
169 <p>
170 <table cellspacing="0" class="body" cellpadding="2" border="0" width="80%">
171 <colgroup>
172 <col width="15%"/>
173 <col width="35%"/>
174 <col width="50%"/>
175 </colgroup>
176 <thead>
177 <tr valign="top">
178 <th class="categorylist">Key</th>
179 <th class="categorylist">Value</th>
180 <th class="categorylist">Description</th>
181 </tr>
182 </thead>
183 <tbody>
184 <!-- Key 'SPLIT_TYPE' -->
185 <tr valign="top">
186 <td bgcolor="#f3f4f5">
187 <p><tt>SPLIT_TYPE</tt></p>
188 </td>
189 <td bgcolor="#f3f4f5">
190 <p><span class="string">'interval'</span></p>
191 </td>
192 <td bgcolor="#f3f4f5">
193 <p>The method for splitting the <tt>ao</tt></p>
194 </td>
195 </tr>
196 <!-- Key 'START_TIME' -->
197 <tr valign="top">
198 <td bgcolor="#f3f4f5">
199 <p><tt>START_TIME</tt></p>
200 </td>
201 <td bgcolor="#f3f4f5">
202 x.t0 + 40800
203 </td>
204 <td bgcolor="#f3f4f5">
205 <p>A time-object to start at</p>
206 </td>
207 </tr>
208 <!-- Key 'END_TIME' -->
209 <tr valign="top">
210 <td bgcolor="#f3f4f5">
211 <p><tt>END_TIME</tt></p>
212 </td>
213 <td bgcolor="#f3f4f5">
214 x.t0 + 193500
215 </td>
216 <td bgcolor="#f3f4f5">
217 <p>A time-object to end at</p>
218 </td>
219 </tr>
220 </tbody>
221 </table>
222 </p>
223 <p>
224 Notice that in order to perform this action, we access one property of the <tt>ao</tt> object,
225 called "t0". The call to the <tt>t0</tt> methods gives as an output an object of the
226 <tt>time</tt> class. Additionally, it's possibly to directly add a numer (in seconds) to
227 obtain a new time object.
228 </p>
229 <p>
230 Hint: the command-line sequence may be similar to the following:
231 </p>
232 <p>
233 <div class="fragment"><pre>
234 <span class="comment">%% Skip some IFO glitch from the consolidation</span>
235
236 pl_split = plist(<span class="string">'start_time'</span>, x.t0 + 40800, ...
237 <span class="string">'end_time'</span>, x.t0 + 193500);
238
239 x_red = split(x, pl_split);
240 T_red = split(T, pl_split);
241 </pre></div>
242 </p>
243 <p>
244 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
245 <tr width="90%">
246 <td>
247 Note: you can also use the parameter 'times' for split to specify times relative to the first sample.
248 In this case:
249 <div class="fragment"><pre>
250 plist('times', [40800 193500]).
251 </pre>
252 </div>
253 would work.
254 </td>
255 </tr>
256 </table>
257 </p>
258 <p>
259 And we can go proceed, evaluating 2 more <tt>ao</tt>s to compare the effect of skipping the
260 "glitch". After doing that, we can plot
261 them in comparison.
262 </p>
263 <p>Hint:</p>
264 <p>
265 <div class="fragment"><pre>
266 <span class="comment">%% PSD</span>
267 x_red_psd = lpsd(x_red);
268 x_red_psd.setName(<span class="string">'Interferometer'</span>);
269
270 T_red_psd = lpsd(T_red)
271 T_red_psd.setName(<span class="string">'Temperature'</span>);
272
273 <span class="comment">% Plot estimated PSD</span>
274 pl_plot = plist(<span class="string">'Arrangement'</span>, <span class="string">'stacked'</span>, <span class="string">'LineStyles'</span>, {<span class="string">'-'</span>,<span class="string">'-'</span>},<span class="string">'Linecolors'</span>, {<span class="string">'b'</span>, <span class="string">'r'</span>});
275 iplot(sqrt(x_psd), sqrt(x_red_psd), pl_plot);
276 iplot(sqrt(T_psd), sqrt(T_red_psd), pl_plot);
277 </pre></div>
278 </p>
279 <br>
280 <br>
281 <img src="images/ltpda_training_1/topic3/IFO_PSD_1.png" alt="PSD of IFO data" border="1">
282 <br>
283 <br>
284 <img src="images/ltpda_training_1/topic3/T_PSD_1.png" alt="PSD of IFO data" border="1">
285 <br>
286 <br>
287 <h2>Estimating the cross-spectra</h2>
288 <p>
289 We can now proceed and use the
290 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
291 <tr width="90%">
292 <td>
293 <tt>ao/lcpsd</tt>
294 </td>
295 </tr>
296 </table>
297 method to evaluate the cross-spectra of the signals, employing a shorter window in order to reduce the
298 scatter of the estimated values.
299 </p>
300 <p>
301 Hint:
302 </p>
303 <p>
304 <div class="fragment"><pre>
305 <span class="comment">%% CPSD estimate</span>
306 CTx = lcpsd(T_red, x_red);
307 CxT = lcpsd(x_red, T_red);
308 <span class="comment">% Plot estimated CPSD</span>
309 iplot(CTx);
310 iplot(CxT);
311 </pre></div>
312 </p>
313 <br>
314 <br>
315 <img src="images/ltpda_training_1/topic3/IFO_T_CPSD_1.png" alt="CPSD of IFO and T data" border="1">
316 <br>
317 <br>
318 <img src="images/ltpda_training_1/topic3/IFO_T_CPSD_2.png" alt="CPSD of T and IFO data" border="1">
319 <br>
320 <br>
321 <p>
322 As expected, there is a strong low-frequency correlation between the IFO data <tt>x</tt> and the
323 temperature data <tt>T</tt>.
324 </p>
325
326
327 <h2>Estimating the cross-coherence</h2>
328
329 <p>
330 Similarly, we can now proceed and use the
331 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
332 <tr width="90%">
333 <td>
334 <tt>ao/lcohere</tt>
335 </td>
336 </tr>
337 </table>
338 method to evaluate the cross-coherence of the signals. The output will be a [2x2] matrix of <tt>ao</tt>s,
339 and we want to look at one of the off-diagonal terms:
340 </p>
341 <p>
342 <div class="fragment"><pre>
343 <span class="comment">%% Coherence estimate</span>
344 coh = lcohere(T_red, x_red);
345 <span class="comment">% Plot estimated cross-coherence</span>
346 iplot(coh, plist(<span class="string">'YScales'</span>, <span class="string">'lin'</span>))
347 </pre></div>
348 </p>
349 <br>
350 <br>
351 <img src="images/ltpda_training_1/topic3/IFO_T_cohere_1.png" alt="Cross-coherence of T and IFO data" border="1">
352 <br>
353 <br>
354 <p>
355 The coherence approaches 1 at low frequency.
356 </p>
357
358 <h2>Estimating the transfer function of temperature</h2>
359 <p>
360 We want now to perform noise projection, trying to estimate the transfer function of the
361 temperature signal into the interferometer output.
362 In order to do that, we can use the
363 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
364 <tr width="90%">
365 <td>
366 <tt>ao/ltfe</tt>
367 </td>
368 </tr>
369 </table> method.
370 </p>
371 <p>
372 We also want to plot this transfer function to check that the units are correct. <br />
373 Hint:
374
375 <div class="fragment"><pre>
376 <span class="comment">%% transfer function estimate</span>
377 tf = ltfe(T_red, x_red)
378
379 <span class="comment">% Plot estimated TF</span>
380 iplot(tf);
381 </pre></div>
382 </p>
383 <br>
384 <br>
385 <img src="images/ltpda_training_1/topic3/IFO_T_TF_1.png" alt="Transfer function T to IFO" border="1">
386 <br>
387 <br>
388 <p>
389 As expected, the transfer function T -> IFO is well measured at low frequencies.
390 </p>
391
392 <h2>Noise projection</h2>
393 <p>
394 We can eventually perform the noise projection, estimating the amount of the noise in the IFO
395 being actually caused by temperature fluctuations. It's a frequency domain estimate:
396 </p>
397 <p>
398 <div class="fragment"><pre>
399 <span class="comment">%% Noise projection in frequency domain</span>
400
401 proj = T_red_psd.*(abs(tf)).^2;
402 proj.simplifyYunits;
403 proj.setName(<span class="string">'temp. contrib. projection'</span>)
404 <span class="comment">%% Plotting the noise projection in frequency domain</span>
405 iplot(x_red_psd, proj);
406 </pre></div>
407 </p>
408 <p>
409 The contribution of the temperature fluctuations is clearly estimated.
410 </p>
411 <br>
412 <br>
413 <img src="images/ltpda_training_1/topic3/IFO_projection.png" alt="Noise projection of T into IFO" border="1">
414 <br>
415 <br>
416
417 <h2>Saving the results</h2>
418 <p>
419 Let's fininsh this section of the exercise by saving the results on disk, in xml format. We want to keep the
420 results about the Power Spectral Density and Transfer Function Estimates, at least.
421 </p>
422 <p>
423 Hint: the command-line sequence may be similar to the following:
424 <div class="fragment"><pre>
425 <span class="comment">%% Save the PSD data</span>
426 <span class="comment">% Plists for the xml format</span>
427
428 pl_save_x_PSD = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/ifo_psd.xml'</span>);
429 pl_save_T_PSD = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/T_psd.xml'</span>);
430
431 pl_save_xT_CPSD = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/ifo_T_cpsd.xml'</span>);
432 pl_save_xT_cohere = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/ifo_T_cohere.xml'</span>);
433
434 pl_save_xT_TFE = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/T_ifo_tf.xml'</span>);
435 </pre></div>
436 </p>
437 <p>
438 or
439 <div class="fragment"><pre>
440 <span class="comment">% Plists for the mat format</span>
441
442 pl_save_x_PSD = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/ifo_psd.mat'</span>);
443 pl_save_T_PSD = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/T_psd.mat'</span>);
444
445 pl_save_xT_CPSD = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/ifo_T_cpsd.mat'</span>);
446 pl_save_xT_cohere = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/ifo_T_cohere.mat'</span>);
447
448 pl_save_xT_TFE = plist(<span class="string">'filename'</span>, <span class="string">'ifo_temp_example/T_ifo_tf.mat'</span>);
449 </pre></div>
450 </p>
451 <p>and
452 <div class="fragment"><pre>
453 <span class="comment">% Save</span>
454 x_red_psd.save(pl_save_x_PSD);
455 T_red_psd.save(pl_save_T_PSD);
456 CxT.save(pl_save_xT_CPSD);
457 coh.save(pl_save_xT_cohere);
458 tf.save(pl_save_xT_TFE);
459 </pre></div>
460 </p>
461
462 </p>
463
464 <br>
465 <br>
466 <table class="nav" summary="Navigation aid" border="0" width=
467 "100%" cellpadding="0" cellspacing="0">
468 <tr valign="top">
469 <td align="left" width="20"><a href="ltpda_training_topic_3_5.html"><img src=
470 "b_prev.gif" border="0" align="bottom" alt=
471 "Empirical Transfer Function estimation"></a>&nbsp;</td>
472
473 <td align="left">Empirical Transfer Function estimation</td>
474
475 <td>&nbsp;</td>
476
477 <td align="right">Topic 4 - Transfer function models and digital filtering</td>
478
479 <td align="right" width="20"><a href=
480 "ltpda_training_topic_4.html"><img src="b_next.gif" border="0" align=
481 "bottom" alt="Topic 4 - Transfer function models and digital filtering"></a></td>
482 </tr>
483 </table><br>
484
485 <p class="copy">&copy;LTP Team</p>
486 </body>
487 </html>