MKHIGHPASS return a high pass filter miir(). A Butterworth filter is used. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: MKHIGHPASS return a high pass filter miir(). A Butterworth filter is used. CALL: f = mkhighpass(f, pl) VERSION: $Id: mkhighpass.html,v 1.14 2008/03/31 10:27:40 hewitson Exp $ HISTORY: 27-08-2002 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function f = mkhighpass(f, pl) 0002 % MKHIGHPASS return a high pass filter miir(). A Butterworth filter is used. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: MKHIGHPASS return a high pass filter miir(). 0007 % A Butterworth filter is used. 0008 % 0009 % CALL: f = mkhighpass(f, pl) 0010 % 0011 % VERSION: $Id: mkhighpass.html,v 1.14 2008/03/31 10:27:40 hewitson 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 win = find(pl, 'Win'); 0023 0024 if(fc(1) > fs/2) 0025 error('fc must be < fs/2'); 0026 end 0027 0028 0029 f.name = 'std highpass'; 0030 f.fs = fs; 0031 f.ntaps = order+1; 0032 f.a = fir1(order, 2*fc/fs, 'high', win.win); 0033 f.gd = (f.ntaps)/2; 0034 f.gain = g; 0035 f.histout = zeros(1,f.ntaps-1); % initialise output history 0036 0037 0038 % END 0039