view m-toolbox/test/test_miir_filtfilt.m @ 43:bc767aaa99a8
CVS Update
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Tue, 06 Dec 2011 11:09:25 +0100 (2011-12-06) |
parents |
f0afece42f48 |
children |
|
line source
% Test the filtfilt function for the miir class.
%
%
% M Hewitson 02-03-07
%
% $Id: test_miir_filtfilt.m,v 1.18 2009/04/07 17:45:22 ingo Exp $
%
function test_miir_filtfilt()
% make a bandpass filter
pl = plist('type', 'bandpass', 'fs', 1000, 'fc', [50 100], 'order', 3);
f = miir(pl);
% Make an analysis object
nsecs = 10;
fs = 1000;
pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))');
a1 = ao(pl);
% Filter the input data
[a2, f] = filtfilt(a1, plist('filter', f));
% Plot time-series
iplot(a1, a2)
% Make TF
a3 = tfe(a1,a2);
b = a3;
% Plot TF
iplot(b)
plot(b.hist)
% Reproduce from history
a_out = rebuild(b);
iplot(a_out)
plot(a_out.hist)
end