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.7 2008/01/02 17:54:22 ingo Exp $ HISTORY: 27-08-2002 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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.7 2008/01/02 17:54:22 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 f.name = 'std bandreject'; 0032 f.fs = fs; 0033 f.ntaps = 2*order+1; 0034 [f.a, f.b] = cheby1(order, ripple, 2.*fc./fs, 'stop'); 0035 f.gain = g; 0036 f.histin = zeros(1,f.ntaps-1); % initialise input history 0037 f.histout = zeros(1,f.ntaps-1); % initialise output history 0038 0039 % END 0040