Mercurial > hg > ltpda
comparison m-toolbox/test/test_ao_ltfe.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_ao_ltfe() | |
2 % Test tfe functionality. | |
3 % | |
4 % M Hewitson 13-02-07 | |
5 % | |
6 % $Id: test_ao_ltfe.m,v 1.1 2009/03/26 08:48:10 miquel Exp $ | |
7 % | |
8 | |
9 %% Make test AOs | |
10 | |
11 nsecs = 10; | |
12 fs = 1000; | |
13 | |
14 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))'); | |
15 | |
16 a1 = ao(pl); | |
17 a1 = a1.setName('input'); | |
18 | |
19 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*17.433*t) + 10*randn(size(t))'); | |
20 | |
21 a3 = ao(pl); | |
22 a3 = a1.setName('input'); | |
23 | |
24 %% Filter one time-series | |
25 | |
26 % Make a filter | |
27 f1 = miir(plist('type', 'highpass', 'fc', 20, 'fs', fs)); | |
28 | |
29 % Filter the input data | |
30 [a2, f1] = filter(a1,plist('filter', f1)); | |
31 | |
32 | |
33 %% Make TF from a1 to a | |
34 | |
35 pl = plist('win', 'Hanning', 'order', -1,'Variance','yes'); | |
36 t1 = ltfe(a1,a2,pl); | |
37 | |
38 %% Use MATLAB directly | |
39 | |
40 [txy, f] = tfestimate(a1.data.y, a2.data.y, win.win, Nfft/2, Nfft, a1.data.fs); | |
41 t2 = ao(fsdata(f.', txy.')); | |
42 | |
43 %% Plot | |
44 | |
45 iplot(t1, t2, plist('LineStyles', {'', '--'},'YErrU',{t1.data.dy,''})) | |
46 % iplot(t1(1,2)./t2') | |
47 |