Mercurial > hg > ltpda
comparison m-toolbox/test/test_ltpda_linedetect.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_LINEDETECT test script for ltpda_linedetect. | |
2 % | |
3 % M Hewitson 14-05-07 | |
4 % | |
5 % $Id: test_ltpda_linedetect.m,v 1.14 2009/02/02 15:20:39 hewitson Exp $ | |
6 % | |
7 function test_ltpda_linedetect() | |
8 | |
9 | |
10 % Make test AOs | |
11 | |
12 nsecs = 10000; | |
13 fs = 10; | |
14 | |
15 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*1.433*t) + 10*sin(2*pi*0.021*t) + randn(size(t))'); | |
16 x12 = ao(pl); | |
17 | |
18 % Make spectrum | |
19 pl = plist('Nfft', round(1000*x12.data.fs')); | |
20 x12xx = psd(x12, pl); | |
21 | |
22 % Detect lines | |
23 pl = plist('N', 100, 'bw', 256, 'hc', 0.9, 'thresh', 2.5); | |
24 x12l = linedetect(x12xx, pl); | |
25 | |
26 % Plot | |
27 ppl = plist('Markers', {'', 'o'}, 'LineStyles', {'', 'None'}); | |
28 iplot([x12xx x12l], ppl); | |
29 plot(x12l.hist) | |
30 | |
31 | |
32 %% Write an m-file from AO | |
33 a_out = rebuild(x12l) | |
34 | |
35 iplot(a_out) | |
36 plot(a_out.hist) | |
37 | |
38 end | |
39 % END | |
40 | |
41 |