comparison m-toolbox/test/test_miir_filtfilt.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % Test the filtfilt function for the miir class.
2 %
3 %
4 % M Hewitson 02-03-07
5 %
6 % $Id: test_miir_filtfilt.m,v 1.18 2009/04/07 17:45:22 ingo Exp $
7 %
8 function test_miir_filtfilt()
9
10 % make a bandpass filter
11 pl = plist('type', 'bandpass', 'fs', 1000, 'fc', [50 100], 'order', 3);
12 f = miir(pl);
13
14 % Make an analysis object
15 nsecs = 10;
16 fs = 1000;
17
18 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))');
19
20 a1 = ao(pl);
21
22 % Filter the input data
23 [a2, f] = filtfilt(a1, plist('filter', f));
24
25 % Plot time-series
26 iplot(a1, a2)
27
28 % Make TF
29 a3 = tfe(a1,a2);
30 b = a3;
31
32 % Plot TF
33 iplot(b)
34 plot(b.hist)
35
36 % Reproduce from history
37 a_out = rebuild(b);
38
39 iplot(a_out)
40 plot(a_out.hist)
41
42 end