comparison m-toolbox/test/test_ao_interp.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_INTERP tests the interp method of AO class.
2 %
3 % M Hewitson 05-06-07
4 %
5 % $Id: test_ao_interp.m,v 1.12 2009/02/02 15:20:38 hewitson Exp $
6 %
7 function test_ao_interp()
8
9 % Make fake AO from polyval
10 nsecs = 100;
11 fs = 10;
12
13 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*1.733*t)');
14 a1 = ao(pl);
15
16 % Interpolate on a new time vector
17 t = linspace(0, a1.data.nsecs - 1/a1.data.fs, 2*len(a1));
18 pl = plist('vertices', t);
19
20 b = interp(a1, pl);
21
22 iplot([a1 b], plist('Markers', {'x', 'o'}, 'LineColors', {'k'}, 'XRanges', [0 1]));
23
24
25 % Reproduce from history
26 a_out = rebuild(b);
27
28 iplot(a_out)
29 plot(a_out.hist)
30
31 end
32 % END