Filter_Butter.m 327 B

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