Repository navigation
Conversation
Not up to standards ⛔
|
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.
speriodogramaccepts matrix input and anaxis, but always computes its FFT along axis 0. It also reshapes repeated windows rather than broadcasting one taper along the sample dimension. As a result, column spectra differ from independent calls on each column; row samples can produce the wrong shape or raise during detrending.Broadcast the selected window along
axis, use that sample count for the default FFT length, and retain the mean's reduced dimension for broadcasting. The FFT uses the same selected axis for real and complex input. The existing one-dimensional results, detrending convention and spectral normalization are preserved. The docstring now explains rows, columns and output shape.For example,
speriodogram(np.arange(24).reshape(8, 3).T, axis=1, NFFT=8, detrend=False)should return shape(3, 5), but currently returns(5, 8).Validation:
These checks establish sample-axis and window consistency, without changing the estimator's normalization or claiming an improvement in statistical quality. Python 3.12 on Linux; other platforms are untested.