comparison m-toolbox/test/test_ao_downsample.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_DOWNSAMPLE tests downsample method of AO class.
2 %
3 % M Hewitson 14-05-07
4 %
5 % $Id: test_ao_downsample.m,v 1.6 2009/02/02 15:20:38 hewitson Exp $
6 %
7 function test_ao_downsample()
8
9 % Make test AOs
10
11 nsecs = 10;
12 fs = 100;
13
14 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*0.433*t)');
15
16 a1 = ao(pl);
17 a1.setName('sine_wave');
18
19 % Decimate
20 a2 = downsample(a1, plist('factor', 2));
21 a3 = downsample(a1, plist('factor', 2, 'offset', 1));
22
23 iplot(a1, a2, a3, plist('Markers', {'x', 'o', 's'}, 'XRanges', [0 0.1]));
24
25
26 % Rebuild
27 a_out = rebuild(a3);
28
29 iplot(a_out)
30 plot(a_out.hist)
31
32 end
33 % END