view m-toolbox/test/test_lpsd_v_pwelch.m @ 45:a59cdb8aaf31 database-connection-manager

Merge
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 19:07:22 +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', '--')