diff m-toolbox/test/test_lincom_cdata.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_lincom_cdata.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,41 @@
+% Test script for ltpda_lincom.
+%
+% M Hewitson 14-02-07
+%
+% $Id: test_lincom_cdata.m,v 1.14 2009/02/02 15:20:38 hewitson Exp $
+%
+function test_lincom_cdata()
+  
+  
+  % Make test AOs
+  nsecs = 10;
+  fs    = 1000;
+  
+  pl = plist();
+  pl.append('nsecs', nsecs);
+  pl.append('fs', fs);
+  pl.append('tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))');
+  
+  a1 = ao(pl);
+  a2 = ao(pl);
+  a3 = ao(pl);
+  a4 = ao(pl);
+  
+  
+  % Make a cdata AO with the coefficients in
+  b  = ao([1 2 3]);
+  
+  %% Make linear combination
+  c = lincom(a1, a2, a3, b);
+  
+  iplot(c)
+  plot(c.hist)
+  
+  % Reproduce from history
+  a_out = rebuild(c);
+  
+  iplot(a_out)
+  plot(a_out.hist)
+  
+end
+% END