Mercurial > hg > ltpda
comparison m-toolbox/test/test_ao_split_samples.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_ao_split_samples() | |
2 % Test AO split method by samples. | |
3 % | |
4 % M Hewitson 02-03-07 | |
5 % | |
6 % $Id: test_ao_split_samples.m,v 1.5 2008/09/19 14:03:50 ingo Exp $ | |
7 % | |
8 | |
9 | |
10 %% make test ao | |
11 a1 = ao(plist('tsfcn', 'sin(2*pi*0.1*t)', 'nsecs', 100, 'fs', 10)); | |
12 | |
13 %% Make spectrum | |
14 a1xx = pwelch(a1); | |
15 | |
16 %% Split by samples | |
17 samps = [1 100 101 300]; | |
18 | |
19 pl = plist(param('samples', samps)); | |
20 b = split(a1, pl); | |
21 c = split(a1xx, pl); | |
22 | |
23 | |
24 %% Plot | |
25 | |
26 iplot(a1, b) | |
27 iplot(a1xx, c) | |
28 | |
29 b1 = b(1); | |
30 plot(b1.hist) | |
31 | |
32 | |
33 %% Recreate from history | |
34 | |
35 % Write an m-file from AO | |
36 ao2m(b1, 'test.m'); | |
37 | |
38 % now run it | |
39 mc | |
40 a_out = test; | |
41 | |
42 iplot(a_out) | |
43 plot(a_out.hist) | |
44 % END |