comparison m-toolbox/classes/@miir/mkhighpass.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 % MKHIGHPASS return a high pass filter miir(). A Butterworth filter is used.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: MKHIGHPASS return a high pass filter miir().
5 % A Butterworth filter is used.
6 %
7 % CALL: f = mkhighpass(f, pl)
8 %
9 % VERSION: $Id: mkhighpass.m,v 1.9 2011/04/04 11:37:02 hewitson Exp $
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 function f = mkhighpass(f, pl)
14
15 g = find(pl, 'gain');
16 fc = find(pl, 'fc');
17 fs = find(pl, 'fs');
18 order = find(pl, 'order');
19
20 utils.helper.checkFilterOptions(pl);
21
22 % Build filter coefficients
23 [a, b] = butter(order, 2*fc(1)/fs, 'high');
24
25 % Set filter properties
26 f.name = 'highpass';
27 f.fs = fs;
28 f.a = g.*a;
29 f.b = b;
30 f.histin = zeros(1,f.ntaps-1); % initialise input history
31 f.histout = zeros(1,f.ntaps-1); % initialise output history
32 end
33