Repository navigation
Conversation
Member
|
I would assume YAGNI on this, and only add it if users ask. (I think filtering is common enough it was worth adding there, but hilbert is pretty niche functionality I think, so the intersection with |
Contributor
Author
|
Thanks Eric, that makes sense. I wanted to explore whether the available signal could be preserved when missing values are present. I understand your point about adding functionality only when there is a practical need for it. We can leave this PR for now, and we can revisit it if users request it in the future |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While going through the Hilbert transformation in our MNE, I looked at that when a single missing sample can cause the entire transformed signal to become NaN. I wanted to check whether available parts of the signal could be processed without filling in the missing values. So i developed an nan_policy="segment" parameter that can transforms valid segments independently while keeping the default behaviour unchanged.
I tested this approach using synthetic signals and real EEG data with artificial gaps, with 555 tests passing and 48 skipped. This current approach supports CPU processing and may introduce artifacts near segment boundaries. I used ChatGPT to help understand the existing implementation. But I have made the changes on my own, understood the actual implementation and verified the results through local testing.