Mercurial > hg > ltpda
diff m-toolbox/test/test_pzm_fngen.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_pzm_fngen.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,27 @@ +% Tests the fngen method of the pzmodel class. +% +% M Hewitson 18-04-08 +% +% $Id: test_pzm_fngen.m,v 1.2 2008/06/13 13:51:46 hewitson Exp $ +% +clear all; + + +% pole zero model +pzm = pzmodel(1, [pz(0.1, 2) pz(0.5, 40)] , [pz(.03) pz(1.55, 25)]); + +% Compute time-series +Nsecs = 1e4; % Number of seconds desired +swin = specwin('Kaiser', 10, 150); % Blending window +b = fngen(pzm, plist('Win', swin, 'Nsecs', Nsecs)); % create time-series + +% Plot time-series +iplot(b) + +%% Make spectra and compare to response + +sxx = pwelch(b, plist('Nfft', 100*b.data.fs, 'Scale', 'ASD')); +axx = abs(resp(pzm, plist('f', sxx.data.x))); +% iplot(axx./sxx, plist('YScales', {'All', 'lin'})) +iplot(sxx, axx) +