Mercurial > hg > ltpda
diff m-toolbox/test/test_ao_gapfillingoptim.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/test_ao_gapfillingoptim.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,49 @@ +% Model and generation + + + +fs = 1; + +p1 = pzmodel(1e-8,[pz(1e-3) pz(0.1, 4)],... + [ pz(2e-1) pz(3e-1)]); + +pl3 = plist(); +pl3 = append(pl3, param('pzmodel', p1)); +pl3 = append(pl3, param('fs',fs)); +pl3 = append(pl3, param('nsecs', 3e3)); + +a = ao(pl3); +%% psd + +pl = plist(... + 'Scale','ASD',... + ... 'Win', getappdata(0, 'ltpda_default_spectral_window'), ... + 'Nfft', 1000,... + 'Order', 1); + +% pl = plist('Kdes', 100,... +% 'Jdes', 100000, ... +% 'Order', 1, ... +% 'Scale', 'ASD'); + +ca = psd(a,pl); + +%% plot + +rp1 = resp(p1,plist('f1',1e-3,'f2',100,'nf',1000)); + +iplot(rp1,ca) + +%% gaps +by = mod((1:length(a.data.y))/10, 20)>19; +b = ao(tsdata(double(~by), 10)); +c = a.*b.'; + + +%% +d = c.gapfillingoptim(c, p1); +%% +iplot(psd(a, pl), psd(c, pl), psd(d, pl), resp(p1)) +iplot(a,c,d) + +