Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/upsample_content.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 <h2>Description</h2> | |
2 <p> | |
3 Upsampling is the process of increasing the sampling rate of a signal. <a href="matlab:doc('ao/upsample')"><tt>Upsample</tt></a> increases the sampling rate of the input AOs by an integer factor. LTPDA <a href="matlab:doc('ao/upsample')"><tt>upsample</tt></a> overloads <tt>upsample</tt> function from Matlab Signal Processing Toolbox. This function increases the sampling rate of a signal by inserting (n-1) zeros between samples. The upsampled output has (n*input) samples. In addition, an initial phase can be specified and, thus, a delayed output of the input can be obtained by using this option. | |
4 <br> | |
5 <br> | |
6 <h2>Syntax</h2> | |
7 </p> | |
8 <div class="fragment"><pre> | |
9 <br> | |
10 b = upsample(a, pl) | |
11 </pre> | |
12 </div> | |
13 <h2>Parameters</h2> | |
14 <p> | |
15 The following parameters can be set in this method: | |
16 <ul> | |
17 <li> <tt>N</tt> - specify the desired upsample rate </li> | |
18 <li> <tt>phase</tt> - specify an initial phase range [0, N-1]</li> | |
19 </ul> | |
20 </p> | |
21 <p> | |
22 <h2>Examples</h2> | |
23 </p> | |
24 <p> | |
25 1. Upsampling a sequence of random data at original sampling rate of 1 Hz by a factor of 10 with no initial phase. | |
26 </p> | |
27 <div class="fragment"><pre> | |
28 <br> | |
29 pl = plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>,<span class="string">'fs'</span>,1,<span class="string">'yunits'</span>,<span class="string">'m'</span>,<span class="string">'nsecs'</span>,100); | |
30 x = ao(pl); | |
31 pl_up = plist(<span class="string">'N'</span>, 10); <span class="comment">% increase the sampling frequency by a factor of 10</span> | |
32 y = upsample(x, pl_up); <span class="comment">% resample the input AO (x) to obtain the upsampled AO (y)</span> | |
33 iplot(x, y) | |
34 </pre> | |
35 </div> | |
36 </p> | |
37 <br> | |
38 <img src="images/upsample1.png" alt="Upsample" border="3"> | |
39 <br> | |
40 <p> | |
41 2. Upsampling a sequence of random data at original sampling rate of 1 Hz by a factor of 21 with a phase of 20 samples. | |
42 </p> | |
43 <div class="fragment"><pre> | |
44 <br> | |
45 pl = plist(<span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>,<span class="string">'fs'</span>,1,<span class="string">'yunits'</span>,<span class="string">'m'</span>,<span class="string">'nsecs'</span>,100); | |
46 x = ao(pl); | |
47 pl_upphase = plist(<span class="string">'N'</span>, 21,<span class=string>'phase'</span>, 20); <span class="comment">% increase the sampling frequency and add phase of 20 samples to upsampled data</span> | |
48 y = upsample(x, pl_upphase); <span class="comment">% resample the input AO (x) to obtain the upsampled and delayed AO (y)</span> | |
49 iplot(x, y) | |
50 </pre> | |
51 </div> | |
52 </p> | |
53 <br> | |
54 <img src="images/upsample2.png" alt="Upsample" border="3"> |