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

ENH: Overlap-add filtering for long signals #10

Merged
merged 6 commits into from
Nov 12, 2011

Conversation

mluessi
Copy link
Contributor

@mluessi mluessi commented Oct 26, 2011

Added zero-phase overlap-add filtering for signals longer than 60s (direct FFT filtering is faster for shorter signals). Unified filter function for low/high/band - pass.

@agramfort
Copy link
Member

would it make sense to pass a filter length to the *_filter functions to let users specify the frequency resolution they want (like mne_process_raw does)

something like:

band_pass_filter(x, Fs, Fp1, Fp2, filter_length=XXX)

where XXX is None means use full signal FFT or XXX=4096 means use overlap add with buffers of size 4096. It seems like exposing the N_fft parameter (that btw should be nfft or n_fft)

@mluessi
Copy link
Contributor Author

mluessi commented Nov 10, 2011

Improved code based on your comments. The test now compares direct filtering and overlap-add filtering. Note that due to the different types of convolution (circular and linear with mirrored boundary), the edges of the filtered signal are slightly different. I don't think it is possible to avoid this.

# response
n_edge = min(n_h, len(x))

x_ext = np.r_[2 * x[0] - x[n_edge - 1:0:-1],\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the \ in parenthesis

@agramfort agramfort merged commit 67922cd into mne-tools:master Nov 12, 2011
larsoner added a commit that referenced this pull request Feb 5, 2013
ENH: adding a test for channels / bads mismatch
larsoner added a commit that referenced this pull request Apr 20, 2015
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 this pull request may close these issues.

2 participants