...
[b, a] = butter(2, [lowcut highcut]/(samplerate/2));
y = filter(b, a, x); % only filters in the forward direction
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.
...