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

Adding support for lowpass filter #3665

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jesusdpa1
Copy link

Adding lowpass filter class, useful for processing emg recordings.

Copying the class from highpass filter and applying the require changes

jesusdpa1 and others added 2 commits February 3, 2025 10:46
Adding lowpass filter class, useful for processing emg recordings.

Copying the class from highpass filter and applying the require changes
@yger
Copy link
Collaborator

yger commented Feb 3, 2025

This is an interesting feature, but be careful about the "magic" parameter margin_ms, that should be increased for small low pass frequencies. Indeed, this is the margin that will be consider to avoid border effect while filtering a chunk. While this parameter of 5ms is rather safe for high frequencies typically used in spike sorting, it might be too small for larger frequencies if you can for tens of Herz. (and then, the advanges of chunk based filtering might be lost also, because margin will be as long if not longer than chunk themselves). In fact, I think it would be good if margin_ms could be set automatically, to avoid any misusage by users. Why not setting it automatically to the lowest bounds of the frequencies considered ?

@jesusdpa1
Copy link
Author

jesusdpa1 commented Feb 3, 2025

Thanks @yger! I think I understand but just to make sure you mean setting margin_ms to

fs = recording.get_sampling_frequency()
margin_ms = int((1 / (2.5*freq_max)) * fs / 1000)

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