ENH: signal.ShortTimeFFT: determine arbitrary dual windows #20610
+629
−45
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 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.