MKLOWPASS return a low pass filter mfir(). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: MKLOWPASS return a low pass filter mfir(). CALL: f = mklowpass(f, pl) VERSION: $Id: mklowpass.html,v 1.14 2008/03/31 10:27:40 hewitson Exp $ HISTORY: 27-08-2002 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function f = mklowpass(f, pl) 0002 % MKLOWPASS return a low pass filter mfir(). 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: MKLOWPASS return a low pass filter mfir(). 0007 % 0008 % CALL: f = mklowpass(f, pl) 0009 % 0010 % VERSION: $Id: mklowpass.html,v 1.14 2008/03/31 10:27:40 hewitson Exp $ 0011 % 0012 % HISTORY: 27-08-2002 M Hewitson 0013 % Creation 0014 % 0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0016 0017 g = find(pl, 'gain'); 0018 fc = find(pl, 'fc'); 0019 fs = find(pl, 'fs'); 0020 order = find(pl, 'order'); 0021 win = find(pl, 'Win'); 0022 0023 if(fc(1) > fs/2) 0024 error('fc must be < fs/2'); 0025 end 0026 0027 f.name = 'std lowpass'; 0028 f.fs = fs; 0029 f.ntaps = order+1; 0030 f.a = fir1(order, 2*fc/fs, 'low', win.win); 0031 f.gd = (f.ntaps)/2; 0032 f.gain = g; 0033 f.histout = zeros(1,f.ntaps-1); % initialise output history 0034 0035 % END 0036