Mercurial > hg > ltpda
comparison m-toolbox/test/test_lpsd.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 % A test script for the AO implementation of lpsd. | |
2 % | |
3 % M Hewitson 02-02-07 | |
4 % | |
5 % $Id: test_lpsd.m,v 1.22 2009/02/02 15:20:38 hewitson Exp $ | |
6 % | |
7 function test_lpsd() | |
8 | |
9 | |
10 % Make test AOs | |
11 | |
12 nsecs = 10000; | |
13 fs = 10; | |
14 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))'); | |
15 | |
16 a1 = ao(pl); | |
17 a2 = ao(pl); | |
18 | |
19 % Make LPSD of each | |
20 | |
21 % Window function | |
22 w = specwin('Kaiser', 1000, 150); | |
23 w = specwin('Hanning', 10); | |
24 | |
25 % parameter list for lpsd | |
26 pl = plist('Kdes', 100, 'Jdes', 10000, 'Win', w, 'order', 1); | |
27 | |
28 % use lpsd | |
29 tic | |
30 a3 = lpsd(a1, pl); | |
31 toc | |
32 a4 = lpsd(a2, pl); | |
33 | |
34 iplot(a3) | |
35 | |
36 % add and plot | |
37 a5 = a3+a4; | |
38 iplot(a5*0.5) | |
39 | |
40 % plot history | |
41 plot(a5.hist) | |
42 | |
43 % Reproduce from history | |
44 a_out = rebuild(a5); | |
45 | |
46 iplot(a_out) | |
47 plot(a_out.hist) | |
48 | |
49 | |
50 end |