%% Butterworth_Fco function [outtrace] = Filter_Butter(signal,order,lf,hf,type,fs) if nargin~= 6 error('You should have six input parameters. Check this'); end Wn = [lf,hf]./(fs/2); % non-dimensional scale frequency [z,p,k] = butter(order,Wn,type); [sos,g] = zp2sos(z,p,k); outtrace = filtfilt(sos,g,signal); end