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

Add filters to a stream object #218

Merged
merged 70 commits into from
Mar 7, 2024
Merged

Conversation

mscheltienne
Copy link
Member

@mscheltienne mscheltienne commented Feb 27, 2024

Closes #105

Remaining TODOs:

  • Add container for IIR Stream filters
  • Add creation of a new filter to the base Stream object
  • Add filtering and initial condition estimation within the acquisition loop
  • Write tests for Stream.filter(...)
  • Add notch filtering

@mscheltienne mscheltienne added 🌟 enhancement Proposed improvement or feature request. stream Issues related to the Stream API. labels Feb 27, 2024
@mscheltienne mscheltienne self-assigned this Feb 27, 2024
@mscheltienne mscheltienne added this to the 1.3 milestone Feb 27, 2024
@mscheltienne mscheltienne marked this pull request as draft February 27, 2024 16:07
Copy link
Member Author

@mscheltienne mscheltienne left a comment

Choose a reason for hiding this comment

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

@larsoner To complete the short discussion on the issue, could you have a quick look through this PR, especially through the 2 comments I left?
I'm not convince the initial condition zi stay valid if multiple filters are applied one by one to the same channel. Maybe I need to write some code to combine the filters applied to the same channel and thus prevent any overlap in the picks associated with each filter.

mne_lsl/stream/_base.py Outdated Show resolved Hide resolved
mne_lsl/stream/stream_lsl.py Outdated Show resolved Hide resolved
@mscheltienne
Copy link
Member Author

After a good night of sleep, I'm actually convince that the initial conditions are not valid anymore. I don't see an easy way to set dynamically the zi for each second order filter in the sos output in _acquire, so instead I will ensures filters do not apply to the same channels or combined their sos arrays if they do, outside of the online-loop.

@mscheltienne mscheltienne marked this pull request as ready for review March 7, 2024 20:28
@mscheltienne mscheltienne enabled auto-merge (squash) March 7, 2024 20:28
@mscheltienne mscheltienne enabled auto-merge (squash) March 7, 2024 20:28
@mscheltienne mscheltienne mentioned this pull request Mar 7, 2024
@mscheltienne mscheltienne merged commit f17101c into mne-tools:main Mar 7, 2024
19 of 20 checks passed
@mscheltienne mscheltienne deleted the filters branch March 8, 2024 08:27
mscheltienne added a commit to mscheltienne/mne-lsl that referenced this pull request Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement Proposed improvement or feature request. stream Issues related to the Stream API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Stream.filter to filter signals from the stream
2 participants