Mercurial > hg > ltpda
comparison m-toolbox/test/test_ao_upsample.m @ 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 % TEST_AO_UPSAMPLE tests upsample method of AO class. | |
2 % | |
3 % M Hewitson 14-05-07 | |
4 % | |
5 % $Id: test_ao_upsample.m,v 1.5 2009/02/02 15:20:38 hewitson Exp $ | |
6 % | |
7 function test_ao_upsample() | |
8 | |
9 % Make test AOs | |
10 | |
11 nsecs = 10; | |
12 fs = 100; | |
13 | |
14 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t)'); | |
15 | |
16 a1 = ao(pl); | |
17 a1 = a1.setName('sine_wave'); | |
18 | |
19 % Decimate | |
20 a4 = upsample(a1, plist('N', 2)); | |
21 a5 = upsample(a1, plist('N', 3, 'Phase', 1)); | |
22 | |
23 iplot([a1 a5 a4], plist('XRanges', [0 0.1])); | |
24 | |
25 | |
26 % Rebuild from history | |
27 a_out = rebuild(a5); | |
28 | |
29 iplot([a1 a_out], plist('XRanges', [0 0.1])); | |
30 plot(a_out.hist) | |
31 | |
32 end | |
33 % END |