MKLOWPASS return a low pass filter mfir(). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: MKLOWPASS return a low pass filter mfir(). CALL: f = mklowpass(f, pl) VERSION: $Id: mklowpass.m,v 1.3 2008/08/06 15:03:49 ingo Exp $ HISTORY: 27-08-2002 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % MKLOWPASS return a low pass filter mfir(). 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: MKLOWPASS return a low pass filter mfir(). 0005 % 0006 % CALL: f = mklowpass(f, pl) 0007 % 0008 % VERSION: $Id: mklowpass.m,v 1.3 2008/08/06 15:03:49 ingo Exp $ 0009 % 0010 % HISTORY: 27-08-2002 M Hewitson 0011 % Creation 0012 % 0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0014 0015 function f = mklowpass(f, pl) 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.a = g.*fir1(order, 2*fc/fs, 'low', win.win); 0030 f.gd = (f.ntaps)/2; 0031 f.histout = zeros(1,f.ntaps-1); % initialise output history 0032 0033