Mercurial > hg > ltpda
comparison m-toolbox/test/test_ltpda_lpsd_new.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_ltpda_lpsd_new() | |
2 % A test script for the AO implementation of lpsd. | |
3 % | |
4 % M Hewitson 02-02-07 | |
5 % | |
6 % $Id: test_ltpda_lpsd_new.m,v 1.4 2008/07/20 19:55:43 hewitson Exp $ | |
7 % | |
8 | |
9 clear all; | |
10 | |
11 %% Make test AOs | |
12 | |
13 nsecs = 10000; | |
14 fs = 10; | |
15 | |
16 pl = plist(); | |
17 pl.append('nsecs', nsecs); | |
18 pl.append('fs', fs); | |
19 pl.append('tsfcn', 'sin(2*pi*1.433*t) + randn(size(t))'); | |
20 | |
21 a1 = ao(pl); | |
22 | |
23 %% Make LPSD of each | |
24 | |
25 % Window function | |
26 w = specwin('Hanning', 10); | |
27 | |
28 % parameter list for lpsd | |
29 pl = plist(); | |
30 pl.append('Kdes', 100); | |
31 pl.append('Kmin', 2); | |
32 pl.append('Jdes', 1000); | |
33 pl.append('Win', w); | |
34 pl.append('Order', 1); | |
35 | |
36 | |
37 %% use new lpsd | |
38 a4 = lpsd(a1, pl); | |
39 | |
40 %% use old ltpda_lpsd | |
41 a5 = ltpda_lpsd(a1, pl); | |
42 | |
43 %% use new m-file only | |
44 a6 = lpsd(a1, pl, plist('M-FILE ONLY', 'YES')); | |
45 | |
46 %% add and plot | |
47 iplot(a4, a5, a6, plist('Legends', {'new mex','old mex', 'new m-file'}, 'LineStyles', {'-', '--', ':'})) | |
48 | |
49 r1 = a4./a5; | |
50 r2 = a4./a6; | |
51 iplot(r1, r2, plist('YScales', 'lin')) | |
52 |