diff m-toolbox/test/test_stuttgart_diff_acc.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_stuttgart_diff_acc.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,69 @@
+% function test_stuttgart_diff_acc()
+
+% TEST_STUTTGART_DIFF_ACC
+% 
+
+%% Input AOs
+
+pl = plist();
+pl = append(pl, param('nsecs', 10));
+pl = append(pl, param('fs', 100));
+pl = append(pl, param('tsfcn', 'randn(size(t))'));
+
+X1   = ao('X1.xml');
+X12  = ao('X12.xml');
+Fsus = ao('Fsus.xml');
+
+%% Plot time-series
+
+pl = plist(param('times', [10 20000]));
+X1   = split(X1, pl);
+X12  = split(X12, pl);
+Fsus = split(Fsus, pl);
+
+figure
+plot([X1 X12 Fsus])
+% ltpda_xaxis(0, 100)
+
+
+
+%% Detrend
+pl = plist(param('N', 0));
+
+X1dt   = ltpda_polydetrend(X1, pl);
+X12dt  = ltpda_polydetrend(X12, pl);
+Fsusdt = ltpda_polydetrend(Fsus, pl);
+
+figure
+plot([X1dt X12dt Fsusdt])
+% ltpda_xaxis(0, 100)
+
+%% Call diff_acc
+
+[X1, X2, X3, P] = ltpda_diff_acc(X1dt, X12dt, Fsusdt, plist());
+
+pl = plist(param('times', [20 20000]));
+X1   = split(X1, pl);
+X2   = split(X2, pl);
+X3   = split(X3, pl);
+
+%% Plots
+
+figure
+plot(X3.hist)
+
+
+%% Make PSD estimates
+
+w   = specwin('Hanning', 10);
+% pl  = plist(param('Nfft', 3600));
+pl  = append(pl, param('Win', w));
+
+X3xx = ltpda_pwelch(X3, pl);
+
+figure
+plot(X3xx)
+
+
+
+% END
\ No newline at end of file