view m-toolbox/test/test_lpsd_v_pwelch.m @ 51:9d5c88356247 database-connection-manager

Make unit tests database connection parameters configurable
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:24:37 +0100
parents f0afece42f48
children
line wrap: on
line source

clear all;

%% Load data

fs = 100;
load x.mat;

%% Make AO
a = ao(tsdata(x(1:10000),fs));
a = set(a, 'name', 'a');

%% Make lpsd

win = specwin('Kaiser', 10, 150);

[f,r,m,L,rr,rrr] = ltpda_compute_f(fs, length(x), 100, 1, 200, win.rov/100);

pl = plist();
pl = append(pl, param('Kdes', 100));
pl = append(pl, param('Kmin', 2));
pl = append(pl, param('Jdes', fs*2));
pl = append(pl, param('Win', win));
pl = append(pl, param('Order', 1));
pl = append(pl, param('DEBUG', 'DEBUG'));

axx = ltpda_lpsd(a, pl);

%% Make pwelch

pl = plist();
pl = append(pl, param('Nfft', fs*2));
pl = append(pl, param('Win', win));

wxx = ltpda_pwelch(a, pl);

%%

figure
iplot(axx)
hold on
h = iplot(wxx);
set(h, 'Color', 'b', 'LineStyle', '--')