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

mkbandreject

PURPOSE ^

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

SYNOPSIS ^

function f = mkbandreject(f, pl)

DESCRIPTION ^

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

 CALL:        f = mkbandreject(f, pl)

 VERSION: $Id: mkbandreject.m,v 1.4 2007/08/16 13:27:32 ingo Exp $

 HISTORY: 27-08-2002 M Hewitson
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function f = mkbandreject(f, pl)
0002 % MKBANDREJECT return a low pass filter miir(). A Butterworth filter is used.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: MKBANDREJECT return a low pass filter miir().
0007 %              A Butterworth filter is used.
0008 %
0009 % CALL:        f = mkbandreject(f, pl)
0010 %
0011 % VERSION: $Id: mkbandreject.m,v 1.4 2007/08/16 13:27:32 ingo Exp $
0012 %
0013 % HISTORY: 27-08-2002 M Hewitson
0014 %             Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 g      = find(pl, 'gain');
0019 fc     = find(pl, 'fc');
0020 fs     = find(pl, 'fs');
0021 order  = find(pl, 'order');
0022 ripple = find(pl, 'ripple');
0023 
0024 if(fc > fs/2)
0025   error('fc must be < fs/2');
0026 end
0027 if(fc(1) > fc(2))
0028   error('fc(1) must be < fc(2)');
0029 end
0030 
0031 
0032 f.name  = 'std bandpass';
0033 f.fs    = fs;
0034 f.ntaps = 2*order+1;
0035 [f.a, f.b] = cheby1(order, ripple, 2.*fc./fs, 'stop');
0036 f.g = g;
0037 f.histin   = zeros(1,f.ntaps-1);   % initialise input history
0038 f.histout  = zeros(1,f.ntaps-1);   % initialise output history
0039 
0040 % END
0041

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003