Repository navigation
FIX: Limit NaN propagation during overlap-add FIR filtering - #14614
Conversation
|
@VivinAT04 it looks like your PR description was likely copy-pasted from an LLM, please keep in mind all interactions should be in your own words I think this makes sense but I suspect the code could be DRY'ed with the recent resampling code with a helper, and the tests seem much longer than needed, can you look? |
|
Hi Eric, Thankyou so much for reviewing the Pull Request. Sorry for sounding like LLM, I used them to structure the original PR description so it can be easier for you to understand quicker. I gone through the documentation and may sure i don't repeat this again. Am so sorry. I will writer future interactions in my own words as you said. I looked at the existing FFT resampling implementation and the extracted common Not a number (NAN) window detection logic into a shared helper function called _nan_window_mask(). Both FIR filtering and FFT sampling now uses this helper function. I also simplified the regression tests from 64 to 19 cases. The local test runs resulted in 314 passed. Thanks for your guidance |
larsoner
left a comment
There was a problem hiding this comment.
Trimmed the test to be more compact, marking for merge, thanks @VivinAT04 !
|
🎉 Congrats on merging your first pull request! 🥳 Looking forward to seeing more from you in the future! 💪 |
|
Thanks, Eric, for reviewing my contribution and simplifying the tests. I appreciate your guidance throughout the process. Happy to have my first contribution merged, and I look forward to contributing more to MNE! |
* upstream/main: FIX: Limit NaN propagation during overlap-add FIR filtering (mne-tools#14614) ENH: Add save() to ConductorModel and InverseOperator (mne-tools#14612) FIX: Make minimum-phase firwin2 high-pass filters work with even filter lengths (mne-tools#14627) DOC: Note that cap montages do not line up with fsaverage in template-MRI tutorial (mne-tools#14628) DOC: Say adjacency=None is rarely right for sensor or source data in cluster tests (mne-tools#14629)
Reference issue (if any)
Fixes #12375.
What does this implement/fix?
This addresses excessive NaN propagation during
overlap-add FIR filtering.
The implementation uses finite-support validity masking
to prevent non-finite input samples from contaminating
entire FFT blocks while retaining the existing FFT-based
filtering approach.
Testing and validation
filtering one million clean samples.
Additional information
AI assistance
AI assisted with bug investigation, code
implementation and regression test development.
The tests were executed and the results were
verified locally on macOS.