MKBANDPASS return a bandpass filter mfir(). A Cheby filter is used. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: MKBANDPASS return a bandpass filter mfir(). A Cheby filter is used. CALL: f = mkbandpass(f, pl) VERSION: $Id: mkbandpass.m,v 1.3 2008/08/06 15:03:49 ingo Exp $ HISTORY: 27-08-2002 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % MKBANDPASS return a bandpass filter mfir(). A Cheby filter is used. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: MKBANDPASS return a bandpass filter mfir(). 0005 % A Cheby filter is used. 0006 % 0007 % CALL: f = mkbandpass(f, pl) 0008 % 0009 % VERSION: $Id: mkbandpass.m,v 1.3 2008/08/06 15:03:49 ingo Exp $ 0010 % 0011 % HISTORY: 27-08-2002 M Hewitson 0012 % Creation 0013 % 0014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0015 0016 function f = mkbandpass(f, pl) 0017 0018 g = find(pl, 'gain'); 0019 fc = find(pl, 'fc'); 0020 fs = find(pl, 'fs'); 0021 order = find(pl, 'order'); 0022 win = find(pl, 'Win'); 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 bandpass'; 0032 f.fs = fs; 0033 f.a = g.*fir1(order, 2.*fc/fs, 'bandpass', win.win); 0034 f.gd = (f.ntaps)/2; 0035 f.histout = zeros(1,f.ntaps-1); % initialise output history 0036 0037