-
Notifications
You must be signed in to change notification settings - Fork 216
blank_staturation with a window around saturation signal #1541
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
Open
JulesLebert
wants to merge
6
commits into
SpikeInterface:main
Choose a base branch
from
JulesLebert:clip_window
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
h-mayorquin
requested changes
Apr 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
My thinking in order of descending importance:
- I think that the
ClipRecording
segment should not be modified. Right now, it is very straightforward and does its own thing very well. If we really want to have something like this we can just create anotherRecordingSegment
. In brief, I feel the price of complexity is worse than the price of a small duplication. Finally, this should have some tests. - Are you sure that you need the loop for the numpy implementation? I think that you can calculate where the indexes of
np.were
change by more than one (np.diff
) an just expand to the left and right accordingly. This will avoid the inner loop which is the most costly part of your function. Am I missing something? - I think that numba in general will play bad with our way of parallelizing with the
ChunkRecordingExecutor
. The former because I am not sure if it will require recompling per core which is usually a higher cost than the operation it implements. Have you tested this?
alejoe91
reviewed
May 23, 2023
@JulesLebert is this still being worked on? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
The preprocessing function that removes saturation just remove the samples where the signal reaches the threshold. This changes allow to also remove the signal around these saturations points (useful to remove parts of a recording where the cable was disconnected for example).
The problem with the modified clip function in pure python is that it is very slow. I have tried a vectorised approach that uses a convolve function from scipy.signal but it only improves performances marginally. Therefore, I have included a numba implementation of the function that increases the speed by ~10 times on my machine and that will only run if numba is installed.