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