view m-toolbox/test/test_ltpda_lpsd_new.m @ 2:18e956c96a1b
database-connection-manager
Add LTPDADatabaseConnectionManager implementation. Matlab code
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Sun, 04 Dec 2011 21:23:09 +0100 (2011-12-04) |
parents |
f0afece42f48 |
children |
|
line source
% function test_ltpda_lpsd_new()
% A test script for the AO implementation of lpsd.
%
% M Hewitson 02-02-07
%
% $Id: test_ltpda_lpsd_new.m,v 1.4 2008/07/20 19:55:43 hewitson Exp $
%
clear all;
%% Make test AOs
nsecs = 10000;
fs = 10;
pl = plist();
pl.append('nsecs', nsecs);
pl.append('fs', fs);
pl.append('tsfcn', 'sin(2*pi*1.433*t) + randn(size(t))');
a1 = ao(pl);
%% Make LPSD of each
% Window function
w = specwin('Hanning', 10);
% parameter list for lpsd
pl = plist();
pl.append('Kdes', 100);
pl.append('Kmin', 2);
pl.append('Jdes', 1000);
pl.append('Win', w);
pl.append('Order', 1);
%% use new lpsd
a4 = lpsd(a1, pl);
%% use old ltpda_lpsd
a5 = ltpda_lpsd(a1, pl);
%% use new m-file only
a6 = lpsd(a1, pl, plist('M-FILE ONLY', 'YES'));
%% add and plot
iplot(a4, a5, a6, plist('Legends', {'new mex','old mex', 'new m-file'}, 'LineStyles', {'-', '--', ':'}))
r1 = a4./a5;
r2 = a4./a6;
iplot(r1, r2, plist('YScales', 'lin'))