comparison m-toolbox/test/test_ltpda_cpsd.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_cpsd functionality.
2 %
3 % M Hewitson 13-02-07
4 %
5 % $Id: test_ltpda_cpsd.m,v 1.23 2009/04/07 17:45:22 ingo Exp $
6 %
7 function test_ltpda_cpsd()
8
9 % Make test AOs
10
11 nsecs = 10;
12 fs = 1000;
13 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))');
14
15 a1 = ao(pl);
16 a2 = ao(pl);
17
18 % Filter one time-series
19 % Make a filter
20 pl = plist('type', 'bandpass', 'fs', 1000, 'order', 3, 'fc', [50 250]);
21 f2 = miir(pl);
22
23 % filter the input data
24 [a3, f2] = filter(a1,plist(param('filter', f2)));
25
26 % make some cross-power
27 a4 = a3+a2;
28
29 % Make CPSD
30 a8 = cpsd(a1, a4);
31
32 % Plot results and history
33 iplot(a8);
34 plot(a8.hist);
35
36 % Reproduce from history
37 a_out = rebuild(a8);
38
39 iplot(a_out)
40 plot(a_out.hist)
41
42 end