Mercurial > hg > ltpda
comparison m-toolbox/test/test_ltpda_chkts.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_chkts() | |
2 | |
3 % TEST_LTPDA_CHKTS test script for ltpda_chkts. | |
4 % | |
5 % M Hewitson 02-05-07 | |
6 % | |
7 % $Id: test_ltpda_chkts.m,v 1.2 2008/09/19 14:03:50 ingo Exp $ | |
8 % | |
9 | |
10 %% Make evenly sampled data | |
11 Nsecs = 10; | |
12 fs = 100; | |
13 t = linspace(0, Nsecs-1/fs, Nsecs*fs); | |
14 x = randn(size(t)); | |
15 | |
16 ts = tsdata(t,x); | |
17 a1 = ao(ts); | |
18 a1 = setName(a1, 'evenly sampled data'); | |
19 | |
20 % check these | |
21 if ltpda_chkts(a1) | |
22 disp(sprintf('* ao(%s) passed', get(a1, 'name'))); | |
23 end | |
24 | |
25 %% Make un-evenly sampled data | |
26 Nsecs = 10; | |
27 fs = 100; | |
28 N = Nsecs*fs; | |
29 | |
30 % grow time vector with some noise on sample time | |
31 t = 0; | |
32 for j=2:N | |
33 nt = t(j-1) + 1/fs + 0.000001*rand; | |
34 t = [t nt]; | |
35 end | |
36 | |
37 x = randn(size(t)); | |
38 | |
39 ts = tsdata(t,x); | |
40 a2 = ao(ts); | |
41 a2 = setName(a2, 'unevenly sampled data'); | |
42 | |
43 % check these | |
44 if ltpda_chkts(a2) | |
45 disp(sprintf('* ao(%s) passed', get(a2, 'name'))); | |
46 else | |
47 disp(sprintf('* ao(%s) failed', get(a2, 'name'))); | |
48 end | |
49 | |
50 | |
51 % END |