Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % function test_stuttgart_diff_acc() | |
2 | |
3 % TEST_STUTTGART_DIFF_ACC | |
4 % | |
5 | |
6 %% Input AOs | |
7 | |
8 pl = plist(); | |
9 pl = append(pl, param('nsecs', 10)); | |
10 pl = append(pl, param('fs', 100)); | |
11 pl = append(pl, param('tsfcn', 'randn(size(t))')); | |
12 | |
13 X1 = ao('X1.xml'); | |
14 X12 = ao('X12.xml'); | |
15 Fsus = ao('Fsus.xml'); | |
16 | |
17 %% Plot time-series | |
18 | |
19 pl = plist(param('times', [10 20000])); | |
20 X1 = split(X1, pl); | |
21 X12 = split(X12, pl); | |
22 Fsus = split(Fsus, pl); | |
23 | |
24 figure | |
25 plot([X1 X12 Fsus]) | |
26 % ltpda_xaxis(0, 100) | |
27 | |
28 | |
29 | |
30 %% Detrend | |
31 pl = plist(param('N', 0)); | |
32 | |
33 X1dt = ltpda_polydetrend(X1, pl); | |
34 X12dt = ltpda_polydetrend(X12, pl); | |
35 Fsusdt = ltpda_polydetrend(Fsus, pl); | |
36 | |
37 figure | |
38 plot([X1dt X12dt Fsusdt]) | |
39 % ltpda_xaxis(0, 100) | |
40 | |
41 %% Call diff_acc | |
42 | |
43 [X1, X2, X3, P] = ltpda_diff_acc(X1dt, X12dt, Fsusdt, plist()); | |
44 | |
45 pl = plist(param('times', [20 20000])); | |
46 X1 = split(X1, pl); | |
47 X2 = split(X2, pl); | |
48 X3 = split(X3, pl); | |
49 | |
50 %% Plots | |
51 | |
52 figure | |
53 plot(X3.hist) | |
54 | |
55 | |
56 %% Make PSD estimates | |
57 | |
58 w = specwin('Hanning', 10); | |
59 % pl = plist(param('Nfft', 3600)); | |
60 pl = append(pl, param('Win', w)); | |
61 | |
62 X3xx = ltpda_pwelch(X3, pl); | |
63 | |
64 figure | |
65 plot(X3xx) | |
66 | |
67 | |
68 | |
69 % END |