0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 Poles and zeros can be combined together to create a pole/zero model. In addition to a list of poles
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 and zeros, a gain factor and a delay can be specified such that the resulting model is of the form:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 <br>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 <div align="center">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 <img src="images/pzmodel_tf_eqn.png" alt="Pole/zero model TF" border="3">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 </div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 <br>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 The following sections introduce how to produce and use pole/zero models in the LTPDA environment.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 <ul>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 <li><a href="#direct">Direct form</a></li>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 <li><a href="#plist">Creating from a <tt>plist</tt></a></li>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 <li><a href="#resp">Computing the response of the model</a></li>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 </ul>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 <h2><a name="direct">Direct form</a></h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 The following code fragment creates a pole/zero model consisting of 2 poles and 2 zeros with a gain
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 factor of 10 and a 10ms delay:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 <div class="fragment"><pre>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 >> pzm = pzmodel(10, {[1 2], 3}, {5, 10}, 0.01)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 ---- pzmodel 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 name: None
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 gain: 10
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 delay: 0.01
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 iunits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 ounits: []
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 pole 001: (f=1 Hz,Q=2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 pole 002: (f=3 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 zero 001: (f=5 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 zero 002: (f=10 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 -------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 Notice, you can also pass arrays of <tt>pz</tt> objects to the <tt>pzmodel</tt> constructor, but this
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 should rarely be necessary.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 <h2><a name="plist">Creating from a <tt>plist</tt></a></h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 You can also create a <tt>pzmodel</tt> by passing a parameter list. The following example shows
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 this
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 <div class="fragment"><pre>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 >> pl = plist(<span class="string">'name'</span>, <span class="string">'test model'</span>, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 <span class="string">'gain'</span>, 10, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 <span class="string">'poles'</span>, {[1 2], 3}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 <span class="string">'zeros'</span>, {5, 10}, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 <span class="string">'delay'</span>, 0.01, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 <span class="string">'iunits'</span>, 'm', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 <span class="string">'ounits'</span>, 'V^2');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 >> pzm = pzmodel(pl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 ---- pzmodel 1 ----
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 name: test model
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 gain: 10
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 delay: 0.01
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 iunits: [m]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 ounits: [V^2]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 pole 001: (f=1 Hz,Q=2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 pole 002: (f=3 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 zero 001: (f=5 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 zero 002: (f=10 Hz,Q=NaN)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 -------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 Here we also specified the input units of the transfer function ('iunits') and the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 output units, ('ounits'). In this case, the model represents a transfer function
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 from metres to Volts squared.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 <h2><a name="resp">Computing the response of the model</a></h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 The frequency response of the model can generated using the <tt>resp</tt> method of the
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 <tt>pzmodel</tt> class. To compute the response of the model created above:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 <div class="fragment"><pre>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 >> resp(pzm)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 Since no output was specified, this command produces the following plot:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 <img src="images/pzmodel_resp.png" alt="Pole/zero model resp" border="3" width="600">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 You can also specify the frequency band over which to compute the response by passing a <tt>plist</tt>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 to the <tt>resp</tt> method, as follows:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 </p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 <div class="fragment"><pre>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 >> rpl = plist(<span class="string">'f1'</span>, 0.1, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 <span class="string">'f2'</span>, 1000, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 <span class="string">'nf'</span>, 10000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 >> a = resp(pzm, rpl)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 ----------- ao 01: resp(test model) -----------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 name: resp(test model)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 description:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 data: (0.1,10.0668830776529-i*0.605439551995965) (0.100092155051679,10.067006787497-i*0.606014805088671) (0.100184395028894,10.0671307268392-i*0.606590636924472) (0.100276720009908,10.0672548961078-i*0.607167048174596) (0.100369130073055,10.0673792957318-i*0.607744039511284) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 ----------- fsdata 01 -----------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 fs: NaN
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 x: [1 10000], double
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 y: [1 10000], double
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 xunits: [Hz]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 yunits: [V^(2)][m^(-1)]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 t0: 1970-01-01 00:00:00.000
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 navs: NaN
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 ---------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 hist: pzmodel / resp / $Id: pzmodel_model_content.html,v 1.5 2009/02/24 09:44:39 miquel Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 mfilename:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 mdlfilename:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 -----------------------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 <p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 In this case, the response is returned as an Analysis Object containing <tt>fsdata</tt>. You can now
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 plot the AO using the <tt>iplot</tt> function.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 </p>
|