Mercurial > hg > ltpda
view m-toolbox/test/test_ao_cpsd.m @ 14:6d43f39633b8 database-connection-manager
Remove unused functions from utils.jmysql
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
% Test ao/cpsd functionality. % % M Hewitson 08-05-08 % % $Id: test_ao_cpsd.m,v 1.6 2009/03/26 09:04:05 miquel Exp $ % function test_ao_cpsd() % Make test AOs nsecs = 10; fs = 1000; pl = plist(); pl.append('nsecs', nsecs); pl.append('fs', fs); pl.append('tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))'); a1 = ao(pl); a2 = ao(pl); % Filter one time-series % Make a filter pl = plist('type', 'bandpass', 'fs', 1000, 'order', 3, 'fc', [50 250]); f2 = miir(pl); % filter the input data [a3, f2] = filter(a1,plist('filter', f2)); % make some cross-power a4 = 10.*a3+a2; % Make CPSD from a6 to a7 Nfft = 1000; win = specwin('Hanning', Nfft); pl = plist('Nfft', Nfft, 'Win', win, 'order', 2); a8 = cpsd(a1, a4, pl); % Use matlab [pxy, f] = cpsd(a1.data.y, a4.data.y, win.win, Nfft/2, Nfft, a1.data.fs); a9 = ao(fsdata(f.', pxy.')); % Plot iplot(a8, a9, plist('LineStyles', {'', '--'})) iplot(a8 ./ a9) % Test cpsd(a1,a1) = psd(a1) a10 = cpsd(a1, a1, pl); a11 = psd(a1, pl); iplot(a10,a11) end