Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: The bandpass filter only filters in the forward direction, so you would get the equivalent result in Matlab using 'filter', not 'filtfilt'.

...

  [b, a] = butter(2, [lowcut highcut]/(samplerate/2));

  y = filtfiltfilter(b, a, x);


where lowcut and highcut are low and high cutoff frequencies (Hz), samplerate is the sampling frequency (Hz), x is the unfiltered data, and y is the filtered data.

...