Home > classes > @miir > private > mkbandreject.m

mkbandreject

PURPOSE ^

return a low pass filter miir(). A Butterworth filter is used.

SYNOPSIS ^

function f = mkbandpass(pl)

DESCRIPTION ^

 return a low pass filter miir(). A Butterworth filter is used.
 
     
 M Hewitson 27-08-02

 
 $Id: mkbandreject.html,v 1.1 2007/06/08 14:15:06 hewitson Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function f = mkbandpass(pl)
0002 
0003 % return a low pass filter miir(). A Butterworth filter is used.
0004 %
0005 %
0006 % M Hewitson 27-08-02
0007 %
0008 %
0009 % $Id: mkbandreject.html,v 1.1 2007/06/08 14:15:06 hewitson Exp $
0010 %
0011 
0012 g      = find(pl, 'gain');
0013 fc     = find(pl, 'fc');
0014 fs     = find(pl, 'fs');
0015 order  = find(pl, 'order');
0016 ripple = find(pl, 'ripple');
0017 
0018 if(fc > fs/2)
0019   error('fc must be < fs/2');
0020 end
0021 if(fc(1) > fc(2))
0022   error('fc(1) must be < fc(2)');
0023 end
0024 
0025 
0026 f.name  = 'std bandpass';
0027 f.fs    = fs;
0028 f.ntaps = 2*order+1;
0029 [f.a, f.b] = cheby1(order, ripple, 2.*fc./fs, 'stop');
0030 f.g = g;
0031 f.histin   = zeros(1,f.ntaps-1);   % initialise input history
0032 f.histout  = zeros(1,f.ntaps-1);   % initialise output history
0033 
0034 % END
0035

Generated on Fri 08-Jun-2007 16:09:11 by m2html © 2003