Mercurial > hg > ltpda
diff m-toolbox/test/lisovfit/test_lisovfit_2.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/lisovfit/test_lisovfit_2.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,30 @@ +mc; + +% Make a TF + +fs = 10; +nsecs = 100000; +in = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'nsecs', nsecs, 'yunits', 'm')); + +pzm = pzmodel(0.123, 0.001, 0.4); +filt = miir(pzm, plist('fs', fs)); +filt.setIunits('m'); +filt.setOunits('V'); + +out = filter(in, filt) + ao(plist('tsfcn', '0.0001*randn(size(t))', 'fs', fs, 'nsecs', nsecs)); + +tf = tfe(in, out, plist('order', 2, 'nfft', fs*nsecs)) + +%% Make fitting models + +pzm0 = pzmodel(0.1, 0.001, 0.1); +pzml = pzmodel(0.01, 0.0001, 0.01); +pzmu = pzmodel(1, 0.1, 1); + +pzmfit = lisovfit(tf(1,2), plist('PZM0', pzm0, 'pzml', pzml, 'pzmu', pzmu, 'delay', [0 0.01 100])) + +%% Plot + +iplot(tf(1,2), resp(pzmfit, plist('f', tf(1,2))) ) + +