Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % TEST_LTPDA_XCORR tests the cross-correlation function ltpda_xcorr. | |
2 % | |
3 % M Hewitson 19-06-07 | |
4 % | |
5 % $Id: test_ltpda_xcorr.m,v 1.13 2011/04/09 16:59:57 hewitson Exp $ | |
6 % | |
7 function test_ltpda_xcorr() | |
8 | |
9 | |
10 % Make test AOs | |
11 | |
12 nsecs = 10; | |
13 fs = 1000; | |
14 | |
15 pl = plist(); | |
16 pl.append('nsecs', nsecs); | |
17 pl.append('fs', fs); | |
18 pl.append('tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))'); | |
19 | |
20 a1 = ao(pl); | |
21 | |
22 % Filter one time-series | |
23 | |
24 % Make a filter | |
25 f1 = miir(plist('type', 'highpass', 'fc', 20, 'fs', fs)); | |
26 | |
27 % Filter the input data | |
28 [a2, f1] = filter(a1,plist(param('filter', f1))); | |
29 | |
30 % Make X-correlation from a1 to a2 | |
31 a4 = xcorr(a1,a2, plist(param('Scale', 'coeff'))); | |
32 | |
33 % Plot results and history | |
34 iplot(a4); | |
35 plot(a4.hist); | |
36 | |
37 % Reproduce from history | |
38 a_out = rebuild(a4); | |
39 | |
40 iplot(a_out) | |
41 plot(a_out.hist) | |
42 | |
43 end |