diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/test/test_ao_interp.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,32 @@
+% TEST_AO_INTERP tests the interp method of AO class.
+%
+% M Hewitson 05-06-07
+%
+% $Id: test_ao_interp.m,v 1.12 2009/02/02 15:20:38 hewitson Exp $
+%
+function test_ao_interp()
+  
+  % Make fake AO from polyval
+  nsecs = 100;
+  fs    = 10;
+  
+  pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*1.733*t)');
+  a1 = ao(pl);
+  
+  % Interpolate on a new time vector
+  t = linspace(0, a1.data.nsecs - 1/a1.data.fs, 2*len(a1));
+  pl = plist('vertices', t);
+  
+  b = interp(a1, pl);
+  
+  iplot([a1 b], plist('Markers', {'x', 'o'}, 'LineColors', {'k'}, 'XRanges', [0 1]));
+  
+  
+  % Reproduce from history
+  a_out = rebuild(b);
+  
+  iplot(a_out)
+  plot(a_out.hist)
+  
+end
+% END