[ENH] - Extend spectral power with more FFT options - #354
Merged
Conversation
ryanhammonds
approved these changes
Oct 28, 2025
Member
There was a problem hiding this comment.
Sorry for the delayed review! I missed this.
I suppose part of this has been superseded by #357? Since both updated compute_spectrum_welch?
Edit: just saw you note that this has already been merged! I should read main comment before jumping into code 😅
Member
Author
|
Thanks for checking through! I updated the API list & init, and did drop |
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.
Add a function to compute a spectrum as from the FFT directly.
Why: every so often I find myself wanting to compute a single FFT window, and end up messing around remember how to do so. This adds the option to compute a spectrum from an individual FFT window, following the neurodsp spectral API.
Note that this PR is already merged with #358. In adding this function, since it uses numpy (not scipy like the others) there is no a padding option already available. I added a simplified padding function for a single window, adapted from the one we had before and that is suggested to be removed in #358.
Also, at one point I was using
get_positive_fft_outputsto select positive ffts, but then realized this can be short-cutted by usingnp.rfftinstead ofnp.fft. As such, I think theget_positive_fft_outputscan actually be removed, unless anyone thinks it's useful for some reason?