Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/test_ao_downsample.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,33 @@ +% TEST_AO_DOWNSAMPLE tests downsample method of AO class. +% +% M Hewitson 14-05-07 +% +% $Id: test_ao_downsample.m,v 1.6 2009/02/02 15:20:38 hewitson Exp $ +% +function test_ao_downsample() + + % Make test AOs + + nsecs = 10; + fs = 100; + + pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*0.433*t)'); + + a1 = ao(pl); + a1.setName('sine_wave'); + + % Decimate + a2 = downsample(a1, plist('factor', 2)); + a3 = downsample(a1, plist('factor', 2, 'offset', 1)); + + iplot(a1, a2, a3, plist('Markers', {'x', 'o', 's'}, 'XRanges', [0 0.1])); + + + % Rebuild + a_out = rebuild(a3); + + iplot(a_out) + plot(a_out.hist) + +end +% END