diff m-toolbox/test/test_ltpda_xcorr.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_ltpda_xcorr.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,43 @@
+% TEST_LTPDA_XCORR tests the cross-correlation function ltpda_xcorr.
+%
+% M Hewitson 19-06-07
+%
+% $Id: test_ltpda_xcorr.m,v 1.13 2011/04/09 16:59:57 hewitson Exp $
+%
+function test_ltpda_xcorr()
+  
+  
+  % 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);
+  
+  % Filter one time-series
+  
+  % Make a filter
+  f1 = miir(plist('type', 'highpass', 'fc', 20, 'fs', fs));
+  
+  % Filter the input data
+  [a2, f1] = filter(a1,plist(param('filter', f1)));
+  
+  % Make X-correlation from a1 to a2
+  a4 = xcorr(a1,a2, plist(param('Scale', 'coeff')));
+  
+  % Plot results and history
+  iplot(a4);
+  plot(a4.hist);
+  
+  % Reproduce from history
+  a_out = rebuild(a4);
+  
+  iplot(a_out)
+  plot(a_out.hist)
+  
+end
\ No newline at end of file