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.m,v 1.4 2008/08/06 15:03:50 ingo Exp $ HISTORY: 27-08-2002 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % MKHIGHPASS return a high pass filter miir(). A Butterworth filter is used. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: MKHIGHPASS return a high pass filter miir(). 0005 % A Butterworth filter is used. 0006 % 0007 % CALL: f = mkhighpass(f, pl) 0008 % 0009 % VERSION: $Id: mkhighpass.m,v 1.4 2008/08/06 15:03:50 ingo Exp $ 0010 % 0011 % HISTORY: 27-08-2002 M Hewitson 0012 % Creation 0013 % 0014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0015 0016 function f = mkhighpass(f, pl) 0017 0018 g = find(pl, 'gain'); 0019 fc = find(pl, 'fc'); 0020 fs = find(pl, 'fs'); 0021 order = find(pl, 'order'); 0022 0023 0024 if(fc > fs/2) 0025 error('fc must be < fs/2'); 0026 end 0027 0028 % Build filter coefficients 0029 [a, b] = butter(order, 2*fc/fs, 'high'); 0030 0031 % Set filter properties 0032 f.setName('highpass', 'internal'); 0033 f.setFs(fs); 0034 f.setA(g.*a); 0035 f.setB(b); 0036 f.setHistin(zeros(1,f.ntaps-1)); % initialise input history 0037 f.setHistout(zeros(1,f.ntaps-1)); % initialise output history 0038 0039