00001 function [output_lowpass] = lowpass(B, A, resample_factor, input_lowpass) 00002 00003 [r c] = size(input_lowpass); 00004 00005 % substract offset 00006 input_lowpass_zero = input_lowpass; 00007 for i=1:c 00008 input_lowpass_zero(:,i) = input_lowpass(:,i) - input_lowpass(1,i); 00009 end 00010 00011 % filter 00012 output_lowpass = filter(B, A, input_lowpass_zero); 00013 00014 % add offset again 00015 for i=1:c 00016 output_lowpass(:,i) = output_lowpass(:,i) + input_lowpass(1,i); 00017 end 00018 00019 % resample 00020 output_lowpass = output_lowpass(1:1/resample_factor:r,:);