comparison m-toolbox/html_help/help/ug/ltpda_training_topic_3_5.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>Empirical Transfer Function estimation (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_2_3.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Example 3: Log-scale PSD on MDC1 data"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "ltpda_training_topic_3_6.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="IFO/Temperature Example - Spectral Analysis"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Empirical Transfer Function estimation</h1>
37 <hr>
38
39 <p>
40 <p>
41 Let's run this exercise on empirical estimation of Transfer
42 Functions on the Matlab terminal.</p>
43
44 <p>The idea of the exercise is the following:
45 <ol>
46 <li>simulate some white noise <em>x(t)</em></li>
47 <li>build a band-pass filter <em>F</em></li>
48 <li>pass the input noise <em>x(t)</em> through the filter and add some more noise
49 <em>yn(t)</em> at the output so to have <em>y = F*x(t) + yn(t)</em></li>
50 <li>evaluate and plot the transfer function <em>x -> y</em> </li>
51 </ol>
52 In a flow diagram, the representation is as follows:
53 </p>
54 <img src="images/ltpda_training_1/topic3/TFE_1_flowchart.png"
55 alt="Dataflow for the 1St example of ao/tfe" width="600px" border="1">
56
57 <p>The command-line sequence is the following:
58 <div class="fragment"><pre>
59 <span class="comment">%% General definitions</span>
60 nsecs = 10000;
61 fs = 1;
62 <span class="comment">%% Input noise</span>
63 x = ao(plist(<span class="string">'waveform'</span>, <span class="string">'noise'</span>, <span class="string">'sigma'</span>, 3, <span class="string">'fs'</span>, fs, <span class="string"> 'nsecs'</span>, nsecs, <span class="string">'yunits'</span>, <span class="string">'V'</span>))
64
65 <span class="comment">%% Filter</span>
66 bp_filter = miir(plist(<span class="string">'type'</span>, <span class="string">'bandpass'</span>, <span class="string">'fc'</span>, [0.01 0.1], <span class="string">'fs'</span>, 1, <span class="string">'order'</span>, 3,<span class="string">'iunits'</span>, <span class="string">'V'</span>, <span class="string">'ounits'</span>, <span class="string">'A'</span>))
67 xf = simplifyYunits(filter(x, bp_filter))
68
69 <span class="comment">%% Output noise</span>
70 yn = ao(plist(<span class="string">'waveform'</span>,<span class="string">'noise'</span>, <span class="string">'sigma'</span>, 1, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, xf.nsecs, <span class="string">'yunits'</span>, <span class="string">'A'</span>))
71 y = xf + yn
72
73 <span class="comment">%% Plotting input and output noise</span>
74 xx = psd(x, plist(<span class="string">'scale'</span>,...
75 <span class="string">'ASD'</span>,...
76 <span class="string">'nfft'</span>, 1000))
77 yy = psd(y, plist(<span class="string">'scale'</span>,<span class="string">'ASD'</span>, ...
78 <span class="string">'nfft'</span>, 1000))
79 iplot(xx, yy, plist(<span class="string">'Arrangement'</span>, <span class="string">'subplots'</span>, <span class="string">'YRanges'</span>, {[1e-1 1e1], [1e-2 1e2]}));
80
81 </pre></div>
82 <img src="images/ltpda_training_1/topic3/TFE_in_out.png" alt="Ohmic admittance between y and x" border="1">
83 <br>
84 <p>Now we can proceed with the call to the <tt>ao/tfe</tt> method. The
85 parameter list is very similar to the one employed for the other spectral
86 estimators:</p>
87
88 <table cellspacing="0" class="body" cellpadding="2" border="0" width="80%">
89 <colgroup>
90 <col width="15%"/>
91 <col width="20%"/>
92 <col width="65%"/>
93 </colgroup>
94 <thead>
95 <tr valign="top">
96 <th class="categorylist">Key</th>
97 <th class="categorylist">Value</th>
98 <th class="categorylist">Description</th>
99 </tr>
100 </thead>
101 <tbody>
102 <!-- Key 'NFFT' -->
103 <tr valign="top">
104 <td bgcolor="#f3f4f5">
105 <p><tt>NFFT</tt></p>
106 </td>
107 <td bgcolor="#f3f4f5">
108 <p><span class="string">1000</span></p>
109 </td>
110 <td bgcolor="#f3f4f5">
111 <p>The number of samples defining the length of the window to apply</p>
112 </td>
113 </tr>
114 <!-- Key 'WIN' -->
115 <tr valign="top">
116 <td bgcolor="#f3f4f5">
117 <p><tt>WIN</tt></p>
118 </td>
119 <td bgcolor="#f3f4f5">
120 <p><span class="string">'BH92'</span></p>
121 </td>
122 <td bgcolor="#f3f4f5">
123 <p>Or a different one, if you want.</p>
124 </td>
125 </tr>
126 <!-- Key 'OLAP' -->
127 <tr valign="top">
128 <td bgcolor="#f3f4f5">
129 <p><tt>OLAP</tt></p>
130 </td>
131 <td bgcolor="#f3f4f5">
132 <p><span class="string">-1</span></p>
133 </td>
134 <td bgcolor="#f3f4f5">
135 <p>Overlap will be chosen based on the window properties</p>
136 </td>
137 </tr>
138 <!-- Key 'ORDER' -->
139 <tr valign="top">
140 <td bgcolor="#f3f4f5">
141 <p><tt>ORDER</tt></p>
142 </td>
143 <td bgcolor="#f3f4f5">
144 <p><span class="string">0</span></p>
145 </td>
146 <td bgcolor="#f3f4f5">
147 <p>Segment-wise detrending up to order 0</p>
148 </td>
149 </tr>
150 </tbody>
151 </table>
152 </p>
153 <p>The command line is the following:</p>
154 <div class="fragment"><pre>
155 <span class="comment">%% Estimate the x->y transfer function</span>
156 tfxy = tfe(x, y, plist(<span class="string">'nfft'</span>, 1000, <span class="string">'win'</span>, <span class="string">'BH92'</span>, <span class="string">'olap'</span>, -1, <span class="string">'order'</span>, 0));
157 </pre></div>
158 <p>We also would like to evaluate the expected transfer function x->y, which is obviously the filter transfer function, or response. This can be calculated by means of the
159 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1">
160 <tr width="90%">
161 <td>
162 <tt>miir/resp</tt>
163 </td>
164 </tr>
165 </table> method. A detailed description of digital filtering is available in the User Manual dedicated <a href="sigproc_dfilt.html" >section</a> and will be touched upon in <a href="ltpda_training_topic_4_4_2.html" >this</a> topic; here let's just use the simplest form, where the needed parameter is a list of the frequency to evaluate the response at:</p>
166 <table cellspacing="0" class="body" cellpadding="2" border="0" width="80%">
167 <colgroup>
168 <col width="15%"/>
169 <col width="35%"/>
170 <col width="50%"/>
171 </colgroup>
172 <thead>
173 <tr valign="top">
174 <th class="categorylist">Key</th>
175 <th class="categorylist">Value</th>
176 <th class="categorylist">Description</th>
177 </tr>
178 </thead>
179 <tbody>
180 <!-- Key 'f' -->
181 <tr valign="top">
182 <td bgcolor="#f3f4f5">
183 <p><tt>F</tt></p>
184 </td>
185 <td bgcolor="#f3f4f5">
186 <p><span class="string">tfxy.x</span></p>
187 </td>
188 <td bgcolor="#f3f4f5">
189 <p>a vector of frequency values or an <tt>ao</tt> whereby the x-axis is taken for the frequency values</p>
190 </td>
191 </tr>
192 </tbody>
193 </table>
194 <p>
195 So we can just pass the x field of the fsdata <tt>ao</tt> containing the transfer function estimate. However,
196 we can also just pass the AO itself. In which case, the <tt>resp</tt> function will take the X values from
197 the AO.
198 </p>
199 <p>
200 The command line is the following:</p>
201 <div class="fragment"><pre>
202 <span class="comment">%% Evaluate the expected x->y transfer function</span>
203 rf = resp(bp_filter, plist(<span class="string">'f'</span>, tfxy))
204 </pre></div>
205
206 <p>Eventually let's look at the results:
207 <div class="fragment"><pre>
208 <span class="comment">%% Plotting estimated and expected transfer functions</span>
209 iplot(tfxy, rf, plist(<span class="string">'colors'</span>,{[1 0 0],[0 0 0]},<span class="string">'YRanges'</span>, {[1e-2 1e2], [-200 200]}))
210 </pre></div>
211 </p>
212 <img src="images/ltpda_training_1/topic3/TFE_result_1.png" alt="TFE of x into y" border="1">
213 <br>
214
215
216 </p>
217
218 <br>
219 <br>
220 <table class="nav" summary="Navigation aid" border="0" width=
221 "100%" cellpadding="0" cellspacing="0">
222 <tr valign="top">
223 <td align="left" width="20"><a href="ltpda_training_topic_3_2_3.html"><img src=
224 "b_prev.gif" border="0" align="bottom" alt=
225 "Example 3: Log-scale PSD on MDC1 data"></a>&nbsp;</td>
226
227 <td align="left">Example 3: Log-scale PSD on MDC1 data</td>
228
229 <td>&nbsp;</td>
230
231 <td align="right">IFO/Temperature Example - Spectral Analysis</td>
232
233 <td align="right" width="20"><a href=
234 "ltpda_training_topic_3_6.html"><img src="b_next.gif" border="0" align=
235 "bottom" alt="IFO/Temperature Example - Spectral Analysis"></a></td>
236 </tr>
237 </table><br>
238
239 <p class="copy">&copy;LTP Team</p>
240 </body>
241 </html>