comparison m-toolbox/test/test_lpsd_v_pwelch.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 clear all;
2
3 %% Load data
4
5 fs = 100;
6 load x.mat;
7
8 %% Make AO
9 a = ao(tsdata(x(1:10000),fs));
10 a = set(a, 'name', 'a');
11
12 %% Make lpsd
13
14 win = specwin('Kaiser', 10, 150);
15
16 [f,r,m,L,rr,rrr] = ltpda_compute_f(fs, length(x), 100, 1, 200, win.rov/100);
17
18 pl = plist();
19 pl = append(pl, param('Kdes', 100));
20 pl = append(pl, param('Kmin', 2));
21 pl = append(pl, param('Jdes', fs*2));
22 pl = append(pl, param('Win', win));
23 pl = append(pl, param('Order', 1));
24 pl = append(pl, param('DEBUG', 'DEBUG'));
25
26 axx = ltpda_lpsd(a, pl);
27
28 %% Make pwelch
29
30 pl = plist();
31 pl = append(pl, param('Nfft', fs*2));
32 pl = append(pl, param('Win', win));
33
34 wxx = ltpda_pwelch(a, pl);
35
36 %%
37
38 figure
39 iplot(axx)
40 hold on
41 h = iplot(wxx);
42 set(h, 'Color', 'b', 'LineStyle', '--')
43