-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
ENH: signal.ShortTimeFFT: determine arbitrary dual windows #20610
base: main
Are you sure you want to change the base?
Conversation
346c75f
to
59a27ca
Compare
@sancholp would you be interested in reviewing this? |
@j-bowhay yes, I'll take a look |
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.
The documentation changes are fine. Maybe somewhere you could explain that the csd spectrogram can also be used to create a coherence spectrogram.
Thanks for looking this, @sancholp. I added a few words explaining a coherence spectrogram in the last commit. On an unrelated side note: The Wikipedia definition of the squared coherency spectrum you cited cannot be extended into a time-frequency version of a spectrogram. The reason being that the definition is based on wide-sense stationary stochastic processes for which time-frequency analysis (as opposed to spectral analysis) is not useful. |
The test failure seems to be unrelated. Update: The rendered documentation can be found here: |
Provide a new function `closest_STFT_dual_window()` to calculate the closest dual window in a least-squares sense for a given desired window as well as a new method `ShortTimeFFT.from_win_equals_dual()` to determine windows which are equal to their dual window.
…ion improvements.
e0c9c3b
to
da15b46
Compare
@DietBru would you be able to resolve the merge conflict |
Thanks for the pointer, @j-bowhay. The current rendered documentation can be found here: |
The ShortTimeFFT can only calculate the canonical dual window (which is utilized in the istft).
This PR provides a new function closest_STFT_dual_window to calculate the closest dual window in a least-squares sense for a given desired window as well as a new method ShortTimeFFT.from_win_equals_dual to determine windows which are equal to their dual window.
The Constant OverLap Add (COLA) constraint is equivalent of having a constant dual window, i.e.,
all(ShortTimeFFT.dual_win == ShortTimeFFT.dual_win[0])
. Hence,closest_STFT_dual_window()
is a generalization of check_COLA, which is deprecated in this PR.Closes #20608 by adding
'math:numref'
to the white list in refguide_check.py.Further minor changes:
_calc_dual_canonical_window(Fixed edgde case i)
fixed edge case for catching invalid zero-valuedwin
.np.int
forhop
parameters._spectral_helper()
Update: The rendered documentation can be found here:
Update: Closes #20622 by adding additional documentation.