-
-
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
DOC: signal: add an example cross-spectrogram application #20622
Comments
cc @DietBru |
SciPy 1.12 introduced a new ShortTimeFFT.spectrogram() method, which also provides cross-spectrogram functionality. @sancholp, do you happen to know of an application for a cross-spectrogram, which would easy to explain in a few words? It would be nice to have a cross-spectrogram example in the ShortTimeFFT.spectrogram() documentation. |
Two signals |
Added an appropriate example in PR #20610 -- reviews and comments are always welcome. |
Is your feature request related to a problem? Please describe.
There is functionality for calculating the
stft
or thespectrogram
(Sxx=Zxx**2
) of a signal, but there is no functionality to do a similar process to analyze the temporal correlations of two signals. A function plotting some kind of "csd spectrogram"Zxy
would be useful. Similarly, a "coherence spectrogram"Sxy
analogous to thespectrogram
function.Describe the solution you'd like.
The function
scipy.stats.stft
calls_spectral_helper(x, x, ...)
. In other words, it calculates the spectral density ofx(f)x*(f)
. To get the csd one would need to call_spectral_helper(x, y, ...)
and calculatex(f)y*(f)
. (See wikipedia).Describe alternatives you've considered.
The package
GWpy
, designed for data analysis in gravitational wave astronomy, already has such functionality. See docs ofcsd_spectrogram
andcoherence_spectrogram
.Additional context (e.g. screenshots, GIFs)
No response
The text was updated successfully, but these errors were encountered: