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