Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/downsample.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>Downsampling data (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 "preproc.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="Signal Pre-processing in LTPDA"></a> <a href= | |
31 "upsample.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Upsampling data"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Downsampling data</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 <h2>Description</h2> | |
41 <p> | |
42 Downsampling is the process of reducing the sampling rate of a signal. <a href="matlab:doc('ao/downsample')"><tt>Downsample</tt></a> | |
43 reduces the sampling rate of the input AOs by an integer factor by picking up one out of N samples. | |
44 Note that no anti-aliasing filter is applied to the original data. Moreover, a <tt>offset</tt> can be | |
45 specified, i.e., the sample at which the output data starts ---see examples below. | |
46 </p> | |
47 <h2>Syntax</h2> | |
48 <div class="fragment"><pre> | |
49 <br> | |
50 b = downsample(a, pl) | |
51 </pre> | |
52 </div> | |
53 <h2>Parameters</h2> | |
54 <p> The following parameters can be set in this method: | |
55 <ul> | |
56 <li> <tt>factor</tt> - decimation factor [by default is 1: no downsampling] (must be an integer) </li> | |
57 <li> <tt>offset</tt> - sample offset for decimation </li> | |
58 </ul> | |
59 </p> | |
60 <p> | |
61 <h2>Examples</h2> | |
62 </p> | |
63 <p> | |
64 1. Downsampling a sequence of random data at original sampling rate of 10 Hz by a factor of 4 (<tt>fsout</tt> = 2.5 Hz) and no <tt>offset</tt>. | |
65 </p> | |
66 <div class="fragment"><pre> | |
67 <br> | |
68 <span class="comment">% create an AO of random data with fs = 10 Hz</span> | |
69 pl = plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>,<span class="string">'fs'</span>,10,<span class="string">'nsecs'</span>,10,<span class="string">'yunits'</span>,<span class="string">'m'</span>); | |
70 x = ao(pl) | |
71 pl_down = plist(<span class="string">'factor'</span>, 4); <span class="comment">% add the decimation factor</span> | |
72 y = downsample(x, pl_down); <span class="comment">% downsample the input AO, x</span> | |
73 iplot(x, y) | |
74 </pre> | |
75 </div> | |
76 | |
77 <img src="images/downsample1.png" alt="Downsample" border="0"> | |
78 | |
79 <p> | |
80 2. Downsampling a sequence of random data at original sampling rate of 10 Hz by a factor of 4 (<tt>fsout</tt> = 2.5 Hz) and <tt>offset</tt> = 10. | |
81 </p> | |
82 <div class="fragment"><pre> | |
83 <br> | |
84 <span class="comment">% create an AO of random data with fs = 10 Hz</span> | |
85 pl = plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>,<span class="string">'fs'</span>,10,<span class="string">'nsecs'</span>,10,<span class="string">'yunits'</span>,<span class="string">'m'</span>); | |
86 x = ao(pl) | |
87 pl_downoff = plist(<span class="string">'factor'</span>, 4,<span class="string">'offset'</span>,10); <span class="comment">% add the decimation factor and the offset parameter</span> | |
88 y = downsample(x, pl_downoff); <span class="comment">% downsample the input AO, x</span> | |
89 iplot(x, y) | |
90 </pre> | |
91 </div> | |
92 | |
93 <img src="images/downsample2.png" alt="Downsample" border="0"> | |
94 | |
95 </p> | |
96 | |
97 <br> | |
98 <br> | |
99 <table class="nav" summary="Navigation aid" border="0" width= | |
100 "100%" cellpadding="0" cellspacing="0"> | |
101 <tr valign="top"> | |
102 <td align="left" width="20"><a href="preproc.html"><img src= | |
103 "b_prev.gif" border="0" align="bottom" alt= | |
104 "Signal Pre-processing in LTPDA"></a> </td> | |
105 | |
106 <td align="left">Signal Pre-processing in LTPDA</td> | |
107 | |
108 <td> </td> | |
109 | |
110 <td align="right">Upsampling data</td> | |
111 | |
112 <td align="right" width="20"><a href= | |
113 "upsample.html"><img src="b_next.gif" border="0" align= | |
114 "bottom" alt="Upsampling data"></a></td> | |
115 </tr> | |
116 </table><br> | |
117 | |
118 <p class="copy">©LTP Team</p> | |
119 </body> | |
120 </html> |