Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/test_ao_split_samples.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,44 @@ +function test_ao_split_samples() +% Test AO split method by samples. +% +% M Hewitson 02-03-07 +% +% $Id: test_ao_split_samples.m,v 1.5 2008/09/19 14:03:50 ingo Exp $ +% + + +%% make test ao +a1 = ao(plist('tsfcn', 'sin(2*pi*0.1*t)', 'nsecs', 100, 'fs', 10)); + +%% Make spectrum +a1xx = pwelch(a1); + +%% Split by samples +samps = [1 100 101 300]; + +pl = plist(param('samples', samps)); +b = split(a1, pl); +c = split(a1xx, pl); + + +%% Plot + +iplot(a1, b) +iplot(a1xx, c) + +b1 = b(1); +plot(b1.hist) + + +%% Recreate from history + +% Write an m-file from AO +ao2m(b1, 'test.m'); + +% now run it +mc +a_out = test; + +iplot(a_out) +plot(a_out.hist) +% END