view m-toolbox/test/lisovfit/test_lisovfit_3.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

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 2], [0.4 3]);
filt = miir(pzm, plist('fs', fs));
filt.setIunits('m');
filt.setOunits('V');

out = filter(in, filt) + ao(plist('tsfcn', '1e-7*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 1], [0.1 1]);
pzml = pzmodel(0.01, [0.0001 0.6], [0.01 0.6]);
pzmu = pzmodel(1,    [0.1 10], [1 10]);

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))) )