comparison m-toolbox/html_help/help/ug/ltpda_training_topic_2_3.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>Resampling a time-series AO (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;">&nbsp;</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 "ltpda_training_topic_2_2.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Upsampling a time-series AO"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "ltpda_training_topic_2_4.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Interpolation of a time-series AO"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Resampling a time-series AO</h1>
37 <hr>
38
39 <p>
40 <p>
41 Resampling is the process of changing the sampling rate of data. The method <tt>ao/resample</tt></a>
42 changes the sampling rate of the input AOs to the desired output sampling frequency by performing band-limited
43 interpolation, or interpolation.
44 </p>
45 <p>
46 If the ratio of the input and the desired output sample rate can be expressed as an integer ratio P/Q where both
47 P and Q then band-limited interpolation can be performed. In this case, the data-series
48 is upsampled (by inserting zeros) and then a low-pass filter is applied at the
49 original Nyquist frequency.
50 </p>
51 <p>
52 The <tt>ao/resample</tt></a> method can be called with the syntax:
53 </p>
54 <div class="fragment"><pre>
55 b = resample(a, pl)
56 </pre>
57 </div>
58 <p>
59 and can accept the following parameters:
60 <table cellspacing="0" class="body" cellpadding="2" border="0" width="80%">
61 <colgroup>
62 <col width="25%"/>
63 <col width="75%"/>
64 </colgroup>
65 <thead>
66 <tr valign="top">
67 <th class="categorylist">Key</th>
68 <th class="categorylist">Description</th>
69 </tr>
70 </thead>
71 <tbody>
72 <!-- Key 'N' -->
73 <tr valign="top">
74 <td bgcolor="#f3f4f5">
75 <p><tt>FSOUT</tt></p>
76 </td>
77 <td bgcolor="#f3f4f5">
78 <p>The desired output frequency (must be positive and integer)</p>
79 </td>
80 </tr>
81 <!-- Key 'FILTER' -->
82 <tr valign="top">
83 <td bgcolor="#f3f4f5">
84 <p><tt>FILTER</tt></p>
85 </td>
86 <td bgcolor="#f3f4f5">
87 <p>The filter to apply in the resampling process</p>
88 </td>
89 </tr>
90 </tbody>
91 </table>
92 </p>
93 <h2>Example 1</h2>
94 <p>
95 Here we will resample a sequence of random data from the original sampling rate of 1 Hz to
96 an output sampling of 50 Hz.
97 </p>
98 <div class="fragment"><pre>
99 pl = plist(<span class="string">'name'</span>, <span class="string">'None'</span>, <span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>,<span class="string">'nsecs'</span>,100,<span class="string">'fs'</span>,1,<span class="string">'yunits'</span>,<span class="string">'m'</span>);
100 x = ao(pl)
101 pl_re = plist(<span class="string">'fsout'</span>, 50);
102 x_re = resample(x, pl_re); <span class="comment">% resample the input AO (x) to obtain the resampled output AO (y)</span>
103 iplot(x, x_re, plist(<span class="string">'XRanges'</span>, [10 20], ...
104 <span class="string">'Markers'</span>, {<span class="string">'o'</span>, <span class="string">'.'</span>}, ...
105 <span class="string">'LineStyles'</span>, {<span class="string">'-'</span>, <span class="string">'none'</span>})) <span class="comment">% plot original and resampled data</span>
106 </pre>
107 </div>
108
109 <img src="images/ltpda_training_1/topic2/re1.png" alt="Resample" border="3">
110
111
112
113
114
115 </p>
116
117 <br>
118 <br>
119 <table class="nav" summary="Navigation aid" border="0" width=
120 "100%" cellpadding="0" cellspacing="0">
121 <tr valign="top">
122 <td align="left" width="20"><a href="ltpda_training_topic_2_2.html"><img src=
123 "b_prev.gif" border="0" align="bottom" alt=
124 "Upsampling a time-series AO"></a>&nbsp;</td>
125
126 <td align="left">Upsampling a time-series AO</td>
127
128 <td>&nbsp;</td>
129
130 <td align="right">Interpolation of a time-series AO</td>
131
132 <td align="right" width="20"><a href=
133 "ltpda_training_topic_2_4.html"><img src="b_next.gif" border="0" align=
134 "bottom" alt="Interpolation of a time-series AO"></a></td>
135 </tr>
136 </table><br>
137
138 <p class="copy">&copy;LTP Team</p>
139 </body>
140 </html>