Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/constructor_examples_ao.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>Constructor examples of the AO class (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 "constructor_examples_general.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="General constructor examples"></a> <a href= | |
31 "constructor_examples_smodel.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Constructor examples of the SMODEL class"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Constructor examples of the AO class</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 | |
41 <!-- -------------------------------------------------- --> | |
42 <!-- --------------- BEGIN CONTENT FILE --------------- --> | |
43 <!-- -------------------------------------------------- --> | |
44 | |
45 | |
46 <!-- --------------- Link box: begin --------------- --> | |
47 <table border="0" summary="Simple list" class="simplelist_nottable_last"> | |
48 <tr> | |
49 <td> | |
50 <a href="constructor_examples_ao.html#empty">Copy an AO</a> | |
51 </td> | |
52 </tr> | |
53 <tr> | |
54 <td> | |
55 <a href="constructor_examples_ao.html#xml_file">Construct an AO by loading the AO from a file</a> | |
56 </td> | |
57 </tr> | |
58 <tr> | |
59 <td> | |
60 <a href="constructor_examples_ao.html#txt_file">Construct an AO from a data file</a> | |
61 </td> | |
62 </tr> | |
63 <tr> | |
64 <td> | |
65 <a href="constructor_examples_ao.html#specwin">Construct an AO from spectral window</a> | |
66 </td> | |
67 </tr> | |
68 <tr> | |
69 <td> | |
70 <a href="constructor_examples_ao.html#plist">Construct an AO from a parameter set</a> | |
71 </td> | |
72 </tr> | |
73 </table> | |
74 <!-- --------------- Link box: end --------------- --> | |
75 | |
76 | |
77 <!-- --------------- NEXT EXAMPLE --------------- --> | |
78 | |
79 <hr> | |
80 <h2 class="title"><a name="empty"></a>Copy an AO</h2> | |
81 <p>The following example creates a copy of an analysis object (blue command).</p> | |
82 <div class="fragment"><pre class="programlisting"> | |
83 >> a1 = ao([1:12]); | |
84 <span class="blue">>> a2 = ao(1)</span> | |
85 ----------- ao: a ----------- | |
86 | |
87 name: none | |
88 creator: created by hewitson@bobmac.aei.uni-hannover.de[130.75.117.65] on MACI/7.6 | |
89 description: | |
90 data: None | |
91 hist: ao / ao / $Id: ao.m,v 1.220 2009/02/25 18:51:24 ingo Exp | |
92 mfilename: | |
93 mdlfilename: | |
94 ----------------------------- | |
95 </pre></div> | |
96 <br></br> | |
97 <p>REMARK: The following command copies only the handle of an object and doesn't create a copy of the object (as above). This means that everything that happens to the copy or original happens to the other object.</p> | |
98 <div class="fragment"><pre class="programlisting"> | |
99 >> a1 = ao() | |
100 ----------- ao 01: a1 ----------- | |
101 name: none | |
102 description: | |
103 data: None | |
104 hist: ao / ao / $Id: ao.m,v 1.220 2009/02/25 18:51:24 ingo Exp | |
105 mfilename: | |
106 mdlfilename: | |
107 --------------------------------- | |
108 >> a2 = a1; | |
109 >> a2.setName(<span class="string">'my new name'</span>) | |
110 ----------- ao 01: my new name ----------- | |
111 name: <span class="string">my new name</span> | |
112 description: | |
113 data: None | |
114 hist: ltpda_uoh / setName / $Id: ao.m,v 1.220 2009/02/25 18:51:24 ingo Exp | |
115 mfilename: | |
116 mdlfilename: | |
117 ------------------------------------------ | |
118 </pre></div> | |
119 <br></br> | |
120 <p>If we display a1 again then we see that the property 'name' was changed although we only have changed a2.</p> | |
121 <div class="fragment"><pre class="programlisting"> | |
122 >> a1 | |
123 ----------- ao 01: my new name ----------- | |
124 name: <span class="string">my new name</span> | |
125 description: | |
126 data: None | |
127 hist: ltpda_uoh / setName / $Id: ao.m,v 1.220 2009/02/25 18:51:24 ingo Exp | |
128 mfilename: | |
129 mdlfilename: | |
130 ------------------------------------------ | |
131 </pre></div> | |
132 | |
133 <!-- --------------- NEXT EXAMPLE --------------- --> | |
134 | |
135 <hr> | |
136 <h2 class="title"><a name="xml_file"></a>Construct an AO by loading the AO from a file</h2> | |
137 <p>The following example creates a new analysis object by loading the analysis object from disk.</p> | |
138 <div class="fragment"><pre class="programlisting"> | |
139 a = ao(<span class="string">'a1.mat'</span>) | |
140 a = ao(<span class="string">'a1.xml'</span>) | |
141 </pre></div> | |
142 <p>or in a <tt>PLIST</tt></p> | |
143 <div class="fragment"><pre class="programlisting"> | |
144 pl = plist(<span class="string">'filename'</span>, <span class="string">'a1.xml'</span>) | |
145 a = ao(pl) | |
146 </pre></div> | |
147 | |
148 <!-- --------------- NEXT EXAMPLE --------------- --> | |
149 | |
150 <hr> | |
151 <h2 class="title"><a name="txt_file"></a>Construct an AO from a data file</h2> | |
152 <p>The following example creates a new analysis object by loading the data in 'file.txt'. The ascii file is assumed to be an equally sampled two-column file of time and amplitude.</p> | |
153 <div class="fragment"><pre class="programlisting"> | |
154 a = ao(<span class="string">'file.txt'</span>) or | |
155 a = ao(<span class="string">'file.dat'</span>) | |
156 </pre></div> | |
157 <br></br> | |
158 <p>The following example creates a new analysis object by loading the data in 'file'. The parameter list determines how the analysis object is created. The valid key/value pairs of the parameter list are: | |
159 </p> | |
160 | |
161 <p> | |
162 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%"> | |
163 <colgroup> | |
164 <col width="25%"/> | |
165 <col width="75%"/> | |
166 </colgroup> | |
167 <thead> | |
168 <tr valign="top"> | |
169 <th class="subcategorylist">Key</th> | |
170 <th class="subcategorylist">Description</th> | |
171 </tr> | |
172 </thead> | |
173 <tbody> | |
174 <tr valign="top"> | |
175 <td> | |
176 <p>'type'</p> | |
177 </td> | |
178 <td> | |
179 <p>'tsdata','fsdata','xydata' [default: 'tsdata']</p> | |
180 </td> | |
181 </tr> | |
182 <tr valign="top"> | |
183 <td> | |
184 <p>'fs'</p> | |
185 </td> | |
186 <td> | |
187 <p>If this value is set, the x-axes is computed by the fs value. [default: empty]</p> | |
188 </td> | |
189 </tr> | |
190 <tr valign="top"> | |
191 <td> | |
192 <p>'columns'</p> | |
193 </td> | |
194 <td> | |
195 <p> | |
196 [1 2 1 4] Each pair represents the <tt>x</tt>- and <tt>y</tt>-axes (each column pair creates an analysis object).<br></br> | |
197 If the value 'fs' is set, then each column is converted to the <tt>y</tt> vector of a time-series AO. [default: [1 2] ] | |
198 </p> | |
199 </td> | |
200 </tr> | |
201 <tr valign="top"> | |
202 <td> | |
203 <p>'comment_char'</p> | |
204 </td> | |
205 <td> | |
206 <p>The comment character in the file [default: '%']</p> | |
207 </td> | |
208 </tr> | |
209 <tr valign="top"> | |
210 <td> | |
211 <p>'description'</p> | |
212 </td> | |
213 <td> | |
214 <p>To set the description in the analysis object</p> | |
215 </td> | |
216 </tr> | |
217 <tr valign="top"> | |
218 <td> | |
219 <p>'...'</p> | |
220 </td> | |
221 <td> | |
222 <p>Every property of the data object e.g. 'name'</p> | |
223 </td> | |
224 </tr> | |
225 </tbody> | |
226 </table> | |
227 </p> | |
228 | |
229 <div class="fragment"><pre class="programlisting"> | |
230 <span class="comment">% Each pair in col represents the x- and y-axes.</span> | |
231 <span class="comment">% 'fs' is not used !!!</span> | |
232 | |
233 pl = plist(<span class="string">'filename'</span>, <span class="string">'data.dat'</span>, ... | |
234 <span class="string">'description'</span>, <span class="string">'my ao description'</span>, ... | |
235 <span class="string">'type'</span>, <span class="string">'xydata'</span>, ... | |
236 <span class="string">'xunits'</span>, <span class="string">'s'</span>, ... | |
237 <span class="string">'yunits'</span>, {<span class="string">'Volt'</span>, <span class="string">'Hz'</span>}, ... | |
238 <span class="string">'columns'</span>, [1 2 1 3], ... | |
239 <span class="string">'comment_char'</span>, <span class="string">'//'</span>); | |
240 | |
241 out = ao(<span class="string">'data.dat'</span>, pl); | |
242 out = ao(pl); | |
243 </pre></div> | |
244 <br></br> | |
245 <p>Another example where the time vector is specified by the sample rate (<tt>fs</tt>) and | |
246 each column of data is converted in to a single AO.</p> | |
247 <div class="fragment"><pre class="programlisting"> | |
248 <span class="comment">% 'fs is used. As such, each column in <tt>col</tt> creates its own AO with the specified sample rate.</span> | |
249 | |
250 pl = plist(<span class="string">'filename'</span>, <span class="string">'data.dat'</span>,... | |
251 <span class="string">'type'</span>, <span class="string">'tsdata'</span>, ... | |
252 <span class="string">'fs'</span>, 100, ... | |
253 <span class="string">'t0'</span>, {<span class="string">'14:00:00'</span>, <span class="string">'14:00:20'</span>, <span class="string">'14:00:30'</span>}, ... | |
254 <span class="string">'columns'</span>, [1 2 3]); | |
255 out = ao(<span class="string">'data.dat'</span>, pl); | |
256 out = ao(pl); | |
257 </pre></div> | |
258 | |
259 <!-- --------------- NEXT EXAMPLE --------------- --> | |
260 | |
261 <hr> | |
262 <h2 class="title"><a name="specwin"></a>Construct an AO from a spectral window</h2> | |
263 <p>The following example creates a cdata type AO containing the window values.</p> | |
264 <div class="fragment"><pre class="programlisting"> | |
265 win = specwin(<span class="string">'Kaiser'</span>, 100, 10); | |
266 >> a = ao(win) | |
267 ----------- ao 01: Kaiser ----------- | |
268 name: Kaiser | |
269 description: | |
270 data: 0.7145 0.7249 0.7351 0.7452 0.7551 0.7649 0.7746 0.7840 0.7934 0.8025 ... | |
271 -------- cdata 01 ------------ | |
272 y: [1x100], double | |
273 yunits: [] | |
274 ------------------------------ | |
275 hist: ao / ao / $Id: fromSpecWin.m,v 1.11 2008/12/05 10:47:14 hewitson Exp --> | |
276 mfilename: | |
277 mdlfilename: | |
278 ------------------------------------- | |
279 </pre></div> | |
280 | |
281 <!-- --------------- NEXT EXAMPLE --------------- --> | |
282 | |
283 <hr> | |
284 <h2 class="title"><a name="plist"></a>Construct an AO from a parameter sets</h2> | |
285 <p>Constructs an analysis object from the description given in the parameter list (in order of priority).</p> | |
286 | |
287 <!-- --------------- Link box: begin --------------- --> | |
288 <table border="0" summary="Simple list" class="simplelist_nottable_last"> | |
289 <tr> | |
290 <td> | |
291 <a href="constructor_examples_ao.html#file">From ASCII File</a> | |
292 </td> | |
293 </tr> | |
294 <tr> | |
295 <td> | |
296 <a href="constructor_examples_ao.html#complexfile">From complex ASCII File</a> | |
297 </td> | |
298 </tr> | |
299 <tr> | |
300 <td> | |
301 <a href="constructor_examples_ao.html#vals">From Values</a> | |
302 </td> | |
303 </tr> | |
304 <tr> | |
305 <td> | |
306 <a href="constructor_examples_ao.html#fcn">From Function</a> | |
307 </td> | |
308 </tr> | |
309 <tr> | |
310 <td> | |
311 <a href="constructor_examples_ao.html#xyfcn">From XY Function</a> | |
312 </td> | |
313 </tr> | |
314 <tr> | |
315 <td> | |
316 <a href="constructor_examples_ao.html#tsfcn">From Time-series Function</a> | |
317 </td> | |
318 </tr> | |
319 <tr> | |
320 <td> | |
321 <a href="constructor_examples_ao.html#fsfcn">From Frequency-series Function</a> | |
322 </td> | |
323 </tr> | |
324 <tr> | |
325 <td> | |
326 <a href="constructor_examples_ao.html#win">From Window</a> | |
327 </td> | |
328 </tr> | |
329 <tr> | |
330 <td> | |
331 <a href="constructor_examples_ao.html#waveform">From Waveform</a> | |
332 </td> | |
333 </tr> | |
334 <tr> | |
335 <td> | |
336 <a href="constructor_examples_ao.html#hostname">From Repository</a> | |
337 </td> | |
338 </tr> | |
339 <tr> | |
340 <td> | |
341 <a href="constructor_examples_ao.html#polyval">From Polynomial</a> | |
342 </td> | |
343 </tr> | |
344 <tr> | |
345 <tr> | |
346 <td> | |
347 <a href="constructor_examples_ao.html#pzmodel">From Pzmodel</a> | |
348 </td> | |
349 </tr> | |
350 </table> | |
351 <!-- --------------- Link box: end --------------- --> | |
352 | |
353 | |
354 <!-- --------------- 'file' --------------- --> | |
355 | |
356 <hr> | |
357 <h3 class="title"><a name="file">From ASCII File</h3> | |
358 <p>The following example creates an analysis object from a datafile. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From ASCII File').tohtml])">here</a> to get more information about the parameters.</p> | |
359 <div class="fragment"><pre class="programlisting"> | |
360 | |
361 <span class="comment">% Construct two analysis-objects with time-series data from</span> | |
362 <span class="comment">% time data in the first column and the data in column 2 and 3 of the file.</span> | |
363 a = ao(plist(<span class="string">'filename'</span>, <span class="string">'data.txt'</span>, <span class="string">'columns'</span>, [1 2 1 3], <span class="string">'type'</span>, <span class="string">'tsdata'</span>)); | |
364 | |
365 <span class="comment">% Construct two analysis-objects with the given frequency and the data in column 1 and 2.</span> | |
366 a = ao(plist(<span class="string">'filename'</span>, <span class="string">'data.txt'</span>, <span class="string">'fs'</span>, 12.1, <span class="string">'columns'</span>, [1 2], <span class="string">'type'</span>, <span class="string">'tsdata'</span>)); | |
367 | |
368 <span class="comment">% Define a comment character for skip comments.</span> | |
369 a = ao(plist(<span class="string">'filename'</span>, <span class="string">'data.txt'</span>, <span class="string">'comment_char'</span>, <span class="string">'#'</span>, <span class="string">'columns'</span>, [1 2 1 3], <span class="string">'type'</span>, <span class="string">'tsdata'</span>)); | |
370 </pre></div> | |
371 | |
372 <!-- --------------- 'complexfile' --------------- --> | |
373 | |
374 <hr> | |
375 <h3 class="title"><a name="complexfile">From complex ASCII File</h3> | |
376 <p>The following example creates an analysis object from a complex datafile. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From complex ASCII File').tohtml])">here</a> to get more information about the parameters.</p> | |
377 <div class="fragment"><pre class="programlisting"> | |
378 | |
379 a = ao(plist(<span class="string">'filename'</span>, <span class="string">'data.txt'</span>, <span class="string">'complex_type'</span>, <span class="string">'real/imag'</span>, <span class="string">'type'</span>, <span class="string">'tsdata'</span>)); | |
380 a = ao(plist(<span class="string">'filename'</span>, <span class="string">'data.txt'</span>, <span class="string">'complex_type'</span>, <span class="string">'real/imag'</span>, <span class="string">'type'</span>, <span class="string">'fsdata'</span>, <span class="string">'columns'</span>, [1,2,4])); | |
381 </pre></div> | |
382 | |
383 <!-- --------------- 'vals' --------------- --> | |
384 | |
385 <hr> | |
386 <h3 class="title"><a name="vals"></a>From Values</h3> | |
387 <p>The following example creates an AO from a set of values. The data type depends on the parameters. | |
388 If you use the parameter key <b>'vals'</b> then you will get an analysis object with cdata. | |
389 Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Values').tohtml])">here</a> for information about the <b>value</b> parameter set or | |
390 <a href="matlab:web(['text://' ao.getInfo('ao', 'From XY Values').tohtml])">here</a> to get more information about the <b>xy-value</b> parameter set. | |
391 </p> | |
392 <div class="fragment"><pre class="programlisting"> | |
393 | |
394 <span class="comment">% cdata</span> | |
395 a = ao(plist(<span class="string">'vals'</span>, [1 2 3], <span class="string">'N'</span>, 10)); | |
396 | |
397 <span class="comment">% xydata</span> | |
398 a = ao(plist(<span class="string">'xvals'</span>, [1 2 3], <span class="string">'yvals'</span>, [10 20 30])); | |
399 | |
400 <span class="comment">% tsdata</span> | |
401 a = ao(plist(<span class="string">'xvals'</span>, [1 2 3], <span class="string">'yvals'</span>, [10 20 30], <span class="string">'type'</span>, <span class="string">'tsdata'</span>)); | |
402 a = ao(plist(<span class="string">'fs'</span>, 1, <span class="string">'yvals'</span>, [10 20 30])); | |
403 | |
404 <span class="comment">% fsdata</span> | |
405 a = ao(plist(<span class="string">'xvals'</span>, [1 2 3], <span class="string">'yvals'</span>, [10 20 30], <span class="string">'type'</span>, <span class="string">'fsdata'</span>)); | |
406 a = ao(plist(<span class="string">'fs'</span>, 1, <span class="string">'yvals'</span>, [10 20 30], <span class="string">'type'</span>, <span class="string">'fsdata'</span>)); | |
407 a = ao(plist(<span class="string">'fs'</span>, 1, <span class="string">'yvals'</span>, [10 20 30], <span class="string">'type'</span>, <span class="string">'fsdata'</span>, <span class="string">'xunits'</span>, <span class="string">'mHz'</span>, <span class="string">'yunits'</span>, <span class="string">'V'</span>)); | |
408 </pre></div> | |
409 | |
410 <!-- --------------- 'fcn' --------------- --> | |
411 | |
412 <hr> | |
413 <h3 class="title"><a name="fcn">From Function</h3> | |
414 <p>The following example creates an AO from the description of any valid MATLAB function. | |
415 The data object is of type <tt>cdata</tt>. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Function').tohtml])">here</a> to get more information about the parameters.</p> | |
416 <div class="fragment"><pre class="programlisting"> | |
417 | |
418 a = ao(plist(<span class="string">'fcn'</span>, <span class="string">'randn(100,1)'</span>)); | |
419 </pre></div> | |
420 <p>You can pass additional parameters to the fcn as extra parameters in the parameter list:</p> | |
421 <div class="fragment"><pre class="programlisting"> | |
422 | |
423 a = ao(plist(<span class="string">'fcn'</span>, <span class="string">'a*b'</span>, <span class="string">'a'</span>, 2, <span class="string">'b'</span>, 1:20)); | |
424 </pre></div> | |
425 | |
426 <!-- --------------- 'xyfcn' --------------- --> | |
427 | |
428 <hr> | |
429 <h3 class="title"><a name="xyfcn"></a>From XY Function</h3> | |
430 <p>Construct an AO from a function f(x) string. The data object is from type <tt>xydata</tt>. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From XY Function').tohtml])">here</a> to get more information about the parameters.</p> | |
431 <div class="fragment"><pre class="programlisting"> | |
432 | |
433 a = ao(plist(<span class="string">'xyfcn'</span>, <span class="string">'cos(2*pi*x) + randn(size(x))'</span>, <span class="string">'x'</span>, [1:1e5])); | |
434 a = ao(plist(<span class="string">'xyfcn'</span>, <span class="string">'log(x)'</span>, <span class="string">'x'</span>, [1:50,52:2:100,110:10:1000])); | |
435 </pre></div> | |
436 | |
437 <!-- --------------- 'tsfcn' --------------- --> | |
438 | |
439 <hr> | |
440 <h3 class="title"><a name="tsfcn"></a>From Time-series Function</h3> | |
441 <p>Construct an AO from a function of time, <tt>t</tt> f(t). The data object is from type <tt>tsdata</tt> (time-series data). Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Time-series Function').tohtml])">here</a> to get more information about the parameters.</p> | |
442 <div class="fragment"><pre class="programlisting"> | |
443 | |
444 a = ao(plist(<span class="string">'fs'</span>, 10, ... | |
445 <span class="string">'nsecs'</span>, 10, ... | |
446 <span class="string">'tsfcn'</span>, <span class="string">'sin(2*pi*1.4*t) + 0.1*randn(size(t))'</span>, ... | |
447 <span class="string">'t0'</span>, <span class="string">'1980-12-01 12:43:12'</span>)); | |
448 a = ao(plist(<span class="string">'tsfcn'</span>, <span class="string">'cos(pi*t) + randn(size(t))'</span>, ... | |
449 <span class="string">'fs'</span>, 1, ... | |
450 <span class="string">'nsecs'</span>, 100)); | |
451 a = ao(plist(<span class="string">'fs'</span>, 10, ... | |
452 <span class="string">'nsecs'</span>, 10, ... | |
453 <span class="string">'tsfcn'</span>, <span class="string">'sin(2*pi*1.4*t)+0.1*randn(size(t))'</span>, ... | |
454 <span class="string">'t0'</span>, time(<span class="string">'1980-12-01 12:43:12'</span>))); | |
455 </pre></div> | |
456 | |
457 <!-- --------------- 'fsfcn' --------------- --> | |
458 | |
459 <hr> | |
460 <h3 class="title"><a name="fsfcn"></a>From Frequency-series Function</h3> | |
461 <p>Construct an AO from a function of frequency, f f(f). The data object is from type <tt>fsdata</tt> (frequency-series). Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Frequency-series Function').tohtml])">here</a> to get more information about the parameters.</p> | |
462 <div class="fragment"><pre class="programlisting"> | |
463 | |
464 a = ao(plist(<span class="string">'fsfcn'</span>, <span class="string">'f'</span>, <span class="string">'f1'</span>, 1e-5, <span class="string">'f2'</span>, 1, <span class="string">'yunits'</span>, <span class="string">'V'</span>)); | |
465 a = ao(plist(<span class="string">'fsfcn'</span>, <span class="string">'f'</span>, <span class="string">'f'</span>, [0.01:0.01:1])); | |
466 a = ao(plist(<span class="string">'fsfcn'</span>, <span class="string">'1./f.^2'</span>, <span class="string">'scale'</span>, <span class="string">'lin'</span>, <span class="string">'nf'</span>, 100)); | |
467 </pre></div> | |
468 | |
469 <!-- --------------- 'win' --------------- --> | |
470 | |
471 <hr> | |
472 <h3 class="title"><a name="win"></a>From Window</h3> | |
473 <p>Construct an AO from a spectral window object.<br /> | |
474 Click <a href="specwin_description.html">here</a> for a list of supported window functions and <a href="matlab:web(['text://' ao.getInfo('ao', 'From Window').tohtml])">here</a> to get more information about the parameters.</p> | |
475 <div class="fragment"><pre class="programlisting"> | |
476 | |
477 a = ao(plist(<span class="string">'win'</span>, specwin(<span class="string">'Hanning'</span>, 100))) | |
478 a = ao(plist(<span class="string">'win'</span>, specwin(<span class="string">'Kaiser'</span>, 10, 150))) | |
479 </pre></div> | |
480 | |
481 <!-- --------------- 'waveform' --------------- --> | |
482 | |
483 % >> | |
484 % >> ao(plist('waveform','noise','type','normal','sigma',2,'nsecs',1000,'fs',1)); | |
485 % >> | |
486 % >> | |
487 % >> | |
488 % >> | |
489 | |
490 <hr> | |
491 <h3 class="title"><a name="waveform"></a>From Waveform</h3> | |
492 <p>Construct an AO from a waveform with the following waveform types. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Waveform').tohtml])">here</a> to get more information about the parameters.</p> | |
493 <div class="fragment"><pre class="programlisting"> | |
494 | |
495 <span class="comment">% Construct random noise</span> | |
496 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'noise'</span>, <span class="string">'type'</span>, <span class="string">'Normal'</span>, <span class="string">'sigma'</span>, 2, <span class="string">'nsecs'</span>, 1000, <span class="string">'fs'</span>, 1)); | |
497 | |
498 <span class="comment">% Construct uniform random noise</span> | |
499 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'noise'</span>, <span class="string">'type'</span>, <span class="string">'Uniform'</span>, <span class="string">'nsecs'</span>, 1000, <span class="string">'fs'</span>, 1)); | |
500 | |
501 <span class="comment">% Construct a sine wave</span> | |
502 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'sine wave'</span>, <span class="string">'A'</span>, 3, <span class="string">'f'</span>, 1, <span class="string">'phi'</span>, pi/2, <span class="string">'toff'</span>, 0.1, <span class="string">'nsecs'</span>, 10, <span class="string">'fs'</span>, 100)); | |
503 | |
504 <span class="comment">% Construct a chirp waveform</span> | |
505 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'chirp'</span>, <span class="string">'f0'</span>, 0.1, <span class="string">'f1'</span>, 1, <span class="string">'t1'</span>, 1, <span class="string">'nsecs'</span>, 5, <span class="string">'fs'</span>, 1000)); | |
506 | |
507 <span class="comment">% Construct a Gaussian pulse waveform</span> | |
508 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'gaussian pulse'</span>, <span class="string">'f0'</span>, 1, <span class="string">'bw'</span>, 0.2, <span class="string">'nsecs'</span>, 20, <span class="string">'fs'</span>, 10)); | |
509 | |
510 <span class="comment">% Construct a Square wave</span> | |
511 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'square wave'</span>, <span class="string">'f'</span>, 2, <span class="string">'duty'</span>, 40, <span class="string">'nsecs'</span>, 10, <span class="string">'fs'</span>, 100)); | |
512 | |
513 <span class="comment">% Construct a Sawtooth wave</span> | |
514 a = ao(plist(<span class="string">'waveform'</span>, <span class="string">'sawtooth'</span>, <span class="string">'f'</span>, 1.23, <span class="string">'width'</span>, 1, <span class="string">'nsecs'</span>, 10/1.23, <span class="string">'fs'</span>, 50)); | |
515 </pre></div> | |
516 | |
517 | |
518 <!-- --------------- 'hostname' --------------- --> | |
519 | |
520 <hr> | |
521 <h3 class="title"><a name="hostname"></a>From Repository</h3> | |
522 <p>Construct an AO by retrieving it from a LTPDA repository. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Repository').tohtml])">here</a> to get more information about the parameters.</p> | |
523 <div class="fragment"><pre class="programlisting"> | |
524 | |
525 <span class="comment">% Retrieves the objects with the object ID 1..10</span> | |
526 a = ao(plist(<span class="string">'hostname'</span>, <span class="string">'123.123.123.123'</span>, <span class="string">'database'</span>, <span class="string">'ltpda_test'</span>, <span class="string">'ID'</span>, [1:10], <span class="string">'binary'</span>, <span class="string">'yes'</span>)); | |
527 </pre></div> | |
528 | |
529 | |
530 <!-- --------------- 'polyval' --------------- --> | |
531 | |
532 <hr> | |
533 <h3 class="title"><a name="polyval"></a>From Polynomial</h3> | |
534 <p>Construct an AO from a set of polynomial coefficients. The relevant parameters are:</p> | |
535 <p> | |
536 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%"> | |
537 <colgroup> | |
538 <col width="25%"/> | |
539 <col width="75%"/> | |
540 </colgroup> | |
541 <thead> | |
542 <tr valign="top"> | |
543 <th class="subcategorylist">Key</th> | |
544 <th class="subcategorylist">Description</th> | |
545 </tr> | |
546 </thead> | |
547 <tbody> | |
548 <tr valign="top"> | |
549 <td> | |
550 <p>'polyval'</p> | |
551 </td> | |
552 <td> | |
553 <p>A set of polynomial coefficients. [default: [] ]</p> | |
554 </td> | |
555 </tr> | |
556 </tbody> | |
557 </table> | |
558 </p> | |
559 <p>Additional parameters:</p> | |
560 <p> | |
561 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%"> | |
562 <colgroup> | |
563 <col width="25%"/> | |
564 <col width="75%"/> | |
565 </colgroup> | |
566 <thead> | |
567 <tr valign="top"> | |
568 <th class="subcategorylist">Key</th> | |
569 <th class="subcategorylist">Description</th> | |
570 </tr> | |
571 </thead> | |
572 <tbody> | |
573 <tr valign="top"> | |
574 <td> | |
575 <p>'nsecs'</p> | |
576 </td> | |
577 <td> | |
578 <p>Number of seconds [default: 10]</p> | |
579 </td> | |
580 </tr> | |
581 <tr valign="top"> | |
582 <td> | |
583 <p>'fs'</p> | |
584 </td> | |
585 <td> | |
586 <p>Sample rate[default: 10 s]</p> | |
587 </td> | |
588 </tr> | |
589 </tbody> | |
590 </table> | |
591 </p> | |
592 <p>or</p> | |
593 <p> | |
594 <table cellspacing="0" border="0" cellpadding="2" class="simplelist_nottable_last" width="80%"> | |
595 <colgroup> | |
596 <col width="25%"/> | |
597 <col width="75%"/> | |
598 </colgroup> | |
599 <thead> | |
600 <tr valign="top"> | |
601 <th class="subcategorylist">Key</th> | |
602 <th class="subcategorylist">Description</th> | |
603 </tr> | |
604 </thead> | |
605 <tbody> | |
606 <tr valign="top"> | |
607 <td> | |
608 <p>'t'</p> | |
609 </td> | |
610 <td> | |
611 <p>vector of time vertices. The value can also be an AO, in which case the X vector is used. [default: [] ]</p> | |
612 </td> | |
613 </tr> | |
614 </tbody> | |
615 </table> | |
616 </p> | |
617 Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Polynomial').tohtml])">here</a> to get more information about the parameters. | |
618 <div class="fragment"><pre class="programlisting"> | |
619 | |
620 a = ao(plist(<span class="string">'polyval'</span>, [1 2 3], <span class="string">'Nsecs'</span>, 10, <span class="string">'fs'</span>, 10)); | |
621 </pre></div> | |
622 | |
623 | |
624 <!-- --------------- 'pzmodel' --------------- --> | |
625 | |
626 <hr> | |
627 <h3 class="title"><a name="pzmodel"></a>From Pzmodel</h3> | |
628 <p>Generates an AO with a timeseries with a prescribed spectrum. Click <a href="matlab:web(['text://' ao.getInfo('ao', 'From Pzmodel').tohtml])">here</a> to get more information about the parameters.</p> | |
629 <div class="fragment"><pre class="programlisting"> | |
630 | |
631 p = [pz(1,2) pz(10)] | |
632 z = [pz(4)] | |
633 pzm = pzmodel(1, p, z) | |
634 | |
635 fs = 10 | |
636 nsecs = 100 | |
637 a = ao(plist(<span class="string">'pzmodel'</span>, pzm, <span class="string">'Nsecs'</span>, nsecs, <span class="string">'Fs'</span>, fs)); | |
638 </pre></div> | |
639 | |
640 | |
641 <!-- ------------------------------------------------ --> | |
642 <!-- --------------- END CONTENT FILE --------------- --> | |
643 <!-- ------------------------------------------------ --> | |
644 | |
645 </p> | |
646 | |
647 <br> | |
648 <br> | |
649 <table class="nav" summary="Navigation aid" border="0" width= | |
650 "100%" cellpadding="0" cellspacing="0"> | |
651 <tr valign="top"> | |
652 <td align="left" width="20"><a href="constructor_examples_general.html"><img src= | |
653 "b_prev.gif" border="0" align="bottom" alt= | |
654 "General constructor examples"></a> </td> | |
655 | |
656 <td align="left">General constructor examples</td> | |
657 | |
658 <td> </td> | |
659 | |
660 <td align="right">Constructor examples of the SMODEL class</td> | |
661 | |
662 <td align="right" width="20"><a href= | |
663 "constructor_examples_smodel.html"><img src="b_next.gif" border="0" align= | |
664 "bottom" alt="Constructor examples of the SMODEL class"></a></td> | |
665 </tr> | |
666 </table><br> | |
667 | |
668 <p class="copy">©LTP Team</p> | |
669 </body> | |
670 </html> |