Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filt vs filtfilt (MATLAB implementation) #107

Closed
sappelhoff opened this issue Nov 19, 2021 · 0 comments · Fixed by #110
Closed

filt vs filtfilt (MATLAB implementation) #107

sappelhoff opened this issue Nov 19, 2021 · 0 comments · Fixed by #110

Comments

@sappelhoff
Copy link
Owner

@sappelhoff So I'm currently taking a grad course on signal processing, and I think I finally understand the key difference between MNE's highpass filter and EEGLAB's: MNE defaults to applying the filter using a zero-phase method that doesn't result in any phase shift in the signal (the equivalent of filtfilt in MATLAB/Scipy), whereas the EEGLAB filter function I re-implemented here only does a single forward pass (using lfilter), so you end up with phase shift in the signal.

As far as I can tell, other than theoretically being faster (which it isn't in the current implementation) there's absolutely no reason to use a forwards-only filter like EEGLAB does instead of the backwards-forwards zero-phase approach used by MNE. I'm guessing this is a weird legacy carry-over for EEGLAB from the days when people were running EEG analyses on Pentium 3's and PowerPC G4's so CPU cycles were at a major premium. I'll update the "differences" docs to reflect this when I get a chance!

Originally posted by @a-hurst in #71 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant