Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/pzmodel_model.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>Building a model (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;"> </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 "pzmodel.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="Pole/Zero representation"></a> <a href= | |
31 "pzmodel_gui.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Model helper GUI"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Building a model</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 | |
41 <p> | |
42 Poles and zeros can be combined together to create a pole/zero model. In addition to a list of poles | |
43 and zeros, a gain factor and a delay can be specified such that the resulting model is of the form: | |
44 </p> | |
45 <br> | |
46 <div align="center"> | |
47 <img src="images/pzmodel_tf_eqn.png" alt="Pole/zero model TF" border="3"> | |
48 </div> | |
49 <br> | |
50 <p> | |
51 The following sections introduce how to produce and use pole/zero models in the LTPDA environment. | |
52 <ul> | |
53 <li><a href="#direct">Direct form</a></li> | |
54 <li><a href="#plist">Creating from a <tt>plist</tt></a></li> | |
55 <li><a href="#resp">Computing the response of the model</a></li> | |
56 </ul> | |
57 </p> | |
58 | |
59 | |
60 <h2><a name="direct">Direct form</a></h2> | |
61 | |
62 The following code fragment creates a pole/zero model consisting of 2 poles and 2 zeros with a gain | |
63 factor of 10 and a 10ms delay: | |
64 <div class="fragment"><pre> | |
65 >> pzm = pzmodel(10, {[1 2], 3}, {5, 10}, 0.01) | |
66 ---- pzmodel 1 ---- | |
67 name: None | |
68 gain: 10 | |
69 delay: 0.01 | |
70 iunits: [] | |
71 ounits: [] | |
72 pole 001: (f=1 Hz,Q=2) | |
73 pole 002: (f=3 Hz,Q=NaN) | |
74 zero 001: (f=5 Hz,Q=NaN) | |
75 zero 002: (f=10 Hz,Q=NaN) | |
76 ------------------- | |
77 </pre></div> | |
78 <p> | |
79 Notice, you can also pass arrays of <tt>pz</tt> objects to the <tt>pzmodel</tt> constructor, but this | |
80 should rarely be necessary. | |
81 </p> | |
82 | |
83 <h2><a name="plist">Creating from a <tt>plist</tt></a></h2> | |
84 | |
85 <p> | |
86 You can also create a <tt>pzmodel</tt> by passing a parameter list. The following example shows | |
87 this | |
88 </p> | |
89 | |
90 <div class="fragment"><pre> | |
91 >> pl = plist(<span class="string">'name'</span>, <span class="string">'test model'</span>, ... | |
92 <span class="string">'gain'</span>, 10, ... | |
93 <span class="string">'poles'</span>, {[1 2], 3}, ... | |
94 <span class="string">'zeros'</span>, {5, 10}, ... | |
95 <span class="string">'delay'</span>, 0.01, ... | |
96 <span class="string">'iunits'</span>, 'm', ... | |
97 <span class="string">'ounits'</span>, 'V^2'); | |
98 >> pzm = pzmodel(pl) | |
99 ---- pzmodel 1 ---- | |
100 name: test model | |
101 gain: 10 | |
102 delay: 0.01 | |
103 iunits: [m] | |
104 ounits: [V^2] | |
105 pole 001: (f=1 Hz,Q=2) | |
106 pole 002: (f=3 Hz,Q=NaN) | |
107 zero 001: (f=5 Hz,Q=NaN) | |
108 zero 002: (f=10 Hz,Q=NaN) | |
109 ------------------- | |
110 </pre></div> | |
111 <p> | |
112 Here we also specified the input units of the transfer function ('iunits') and the | |
113 output units, ('ounits'). In this case, the model represents a transfer function | |
114 from metres to Volts squared. | |
115 </p> | |
116 | |
117 <h2><a name="resp">Computing the response of the model</a></h2> | |
118 | |
119 <p> | |
120 The frequency response of the model can generated using the <tt>resp</tt> method of the | |
121 <tt>pzmodel</tt> class. To compute the response of the model created above: | |
122 </p> | |
123 <div class="fragment"><pre> | |
124 >> resp(pzm) | |
125 </pre></div> | |
126 <p> | |
127 Since no output was specified, this command produces the following plot: | |
128 <img src="images/pzmodel_resp.png" alt="Pole/zero model resp" border="3" width="600"> | |
129 </p> | |
130 <p> | |
131 You can also specify the frequency band over which to compute the response by passing a <tt>plist</tt> | |
132 to the <tt>resp</tt> method, as follows: | |
133 </p> | |
134 <div class="fragment"><pre> | |
135 >> rpl = plist(<span class="string">'f1'</span>, 0.1, ... | |
136 <span class="string">'f2'</span>, 1000, ... | |
137 <span class="string">'nf'</span>, 10000); | |
138 >> a = resp(pzm, rpl) | |
139 ----------- ao 01: resp(test model) ----------- | |
140 | |
141 name: resp(test model) | |
142 description: | |
143 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) ... | |
144 ----------- fsdata 01 ----------- | |
145 | |
146 fs: NaN | |
147 x: [1 10000], double | |
148 y: [1 10000], double | |
149 xunits: [Hz] | |
150 yunits: [V^(2)][m^(-1)] | |
151 t0: 1970-01-01 00:00:00.000 | |
152 navs: NaN | |
153 --------------------------------- | |
154 | |
155 hist: pzmodel / resp / $Id: pzmodel_model_content.html,v 1.5 2009/02/24 09:44:39 miquel Exp $ | |
156 mfilename: | |
157 mdlfilename: | |
158 ----------------------------------------------- | |
159 </pre></div> | |
160 <p> | |
161 In this case, the response is returned as an Analysis Object containing <tt>fsdata</tt>. You can now | |
162 plot the AO using the <tt>iplot</tt> function. | |
163 </p> | |
164 | |
165 </p> | |
166 | |
167 <br> | |
168 <br> | |
169 <table class="nav" summary="Navigation aid" border="0" width= | |
170 "100%" cellpadding="0" cellspacing="0"> | |
171 <tr valign="top"> | |
172 <td align="left" width="20"><a href="pzmodel.html"><img src= | |
173 "b_prev.gif" border="0" align="bottom" alt= | |
174 "Pole/Zero representation"></a> </td> | |
175 | |
176 <td align="left">Pole/Zero representation</td> | |
177 | |
178 <td> </td> | |
179 | |
180 <td align="right">Model helper GUI</td> | |
181 | |
182 <td align="right" width="20"><a href= | |
183 "pzmodel_gui.html"><img src="b_next.gif" border="0" align= | |
184 "bottom" alt="Model helper GUI"></a></td> | |
185 </tr> | |
186 </table><br> | |
187 | |
188 <p class="copy">©LTP Team</p> | |
189 </body> | |
190 </html> |