comparison m-toolbox/test/testing_xml.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 saving AO to xml
2 %
3 %
4 % $Id: testing_xml.m,v 1.23 2009/07/21 05:16:29 hewitson Exp $
5 %
6 function testing_xml()
7
8
9 % Make test AOs
10 nsecs = 10;
11 fs = 1000;
12
13 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))');
14
15 a1 = ao(pl);
16 a2 = ao(pl);
17
18 % Make LPSD of each
19
20 % Window function
21 w = specwin('Kaiser', 1000, 250);
22
23 % use lpsd
24 a3 = psd(a1);
25 a4 = psd(a2);
26
27 % multiply
28 a5 = a3.*a4;
29 iplot(a5)
30 plot(a5.hist)
31
32 % Save to XML
33 file_name = 'a5.xml';
34 save(a5, file_name);
35
36 % Load
37 file_name = 'a5.xml';
38 b = ao(file_name);
39 iplot(b)
40 plot(b.hist)
41
42 % Rebuild from history
43 a_out = rebuild(b);
44 plot(a_out.hist)
45 iplot(a_out)
46
47 end