0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 <!-- $Id: constructor_examples_fsdata_content.html,v 1.3 2008/03/30 20:40:04 ingo Exp $ -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 <!-- -------------------------------------------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 <!-- --------------- BEGIN CONTENT FILE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 <!-- -------------------------------------------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 <!-- --------------- Link box: begin --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 <table border="0" summary="Simple list" class="simplelist_nottable_last">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 <a href="constructor_examples_fsdata.html#empty">Construct empty FSDATA object</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 <a href="constructor_examples_fsdata.html#xml_file">Construct a FSDATA object by loading the object from a file</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 <a href="constructor_examples_fsdata.html#data_vector">Construct a FSDATA object from a data vector</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 <a href="constructor_examples_fsdata.html#data_freq_vector">Construct a FSDATA object from a data vector and frequency vector</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 <a href="constructor_examples_fsdata.html#data_frequency">Construct a FSDATA object from a data vector and the corresponding frequency</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 <tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 <td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 <a href="constructor_examples_fsdata.html#all">Construct a FSDATA object from a data vector, frequency vector and the corresponding frequency</a>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 </td>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 </tr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 </table>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 <!-- --------------- Link box: end --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 <h2 class="title"><a name="empty"></a>Construct empty FSDATA object</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 <p>The following example creates an empty fsdata object</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 f1 = fsdata()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 ----------- fsdata 01 -----------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 name: None
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 fs: 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 x: [0 0], double
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 y: [0 0], double
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 xunits: Hz
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 yunits:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 ---------------------------------
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 <h2 class="title"><a name="xml_file"></a>Construct a FSDATA object by loading the object from a file</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 <p>The following example creates a new fsdata object by loading the fsdata object from disk.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 f1 = fsdata(<span class="string">'f1.mat'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 f1 = fsdata(<span class="string">'f1.xml'</span>)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 <h2 class="title"><a name="data_vector"></a>Construct a FSDATA object from a data vector</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 <p>creates a frequency-series object with the given y-data. Sample rate of the data is assumed to be 1Hz.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 y = randn(1000,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 f1 = fsdata(y)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 <h2 class="title"><a name="data_freq_vector"></a>Construct a FSDATA object from a data vector and frequency vector</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 <p>creates a frequency-series object with the given (x,y)-data. The sample rate is then set as 2*x(end).</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 fs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 x = linspace(0, fs/2, 1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 y = randn(1000,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 f1 = fsdata(x,y)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 <h2 class="title"><a name="data_frequency"></a>Construct a FSDATA object from a data vector and the corresponding frequency</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 <p>creates a frequency-series object with the given y-data and sample rate. The frequency vector is grown assuming the first y sample corresponds to 0Hz and the last sample corresponds to the Nyquist frequency.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 y = randn(1000,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 fs = 100;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 f1 = fsdata(y,fs)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 <!-- --------------- NEXT EXAMPLE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 <hr>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 <h2 class="title"><a name="all"></a>Construct a FSDATA object from a data vector, frequency vector and the corresponding frequency</h2>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 <p>creates a frequency-series object with the given x,y-data and sample rate.</p>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 <div class="fragment"><pre class="programlisting">
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 fs = 10;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 x = linspace(0, fs/2, 1000);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 y = randn(1000,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 f1 = fsdata(x,y,fs);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 </pre></div>
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 <!-- ------------------------------------------------ -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 <!-- --------------- END CONTENT FILE --------------- -->
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 <!-- ------------------------------------------------ -->
|