view m-toolbox/test/test_lpsd_v_pwelch.m @ 44:409a22968d5e
default
Add unit tests
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Tue, 06 Dec 2011 18:42:11 +0100 (2011-12-06) |
parents |
f0afece42f48 |
children |
|
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', '--')