ENH: Function for bicoherence in scipy?

Note: this is a copy of ENH: Function for bicoherence · Issue #23054 · scipy/scipy , opened here following request from scipy maintainers :slight_smile: .


Bicoherence is commonly used to check for the (possible, it is a necessary not sufficient condition) existence of (non-linear) cross-product effects between 2 frequency modes into a third mode (sometimes called “triad” interactions).

The definition is available on many places, e.g. wikipedia.

It would be great to have the possibility to compute the (auto for now) bicoherence out of the box in scipy.

For now, there are some implementations scattered around (not sure if all are working as intended), e.g.:

Thank you for making this proposal. It is always great read about enhancements pointing in novel directions.

As you might have guessed by the lagging responses, the bicoherence may be a bit too niche for SciPy. The main reason, in my opinion, is the shortage of maintainer resources with expert knowledge in spectral analysis topics. E.g., more common topics like the Wigner distribution (PR 14141) or the cross cyclic spectral density (PR 15519) are not really progressing at a satisfying pace.

Concerning the bicoherence itself, I do have two questions:

  1. It is not clear to how me to select an appropriate parametrization (like segment length, overlap, etc) to obtain statistically consistent results. Considering that the bispectrum is the Fourier transform of the third-order cumulant, it might be helpful to explicitly know the required statistical properties of the input signals for such results. An authoritative reference and tutorials could address that. I am pointing this out, since the spectrogram caused me quite some headaches in that regard (which resulted among other things in this).

  2. What benefit would a SciPy implementation have over a specialized package like PyBispectra? Wouldn’t make more sense to focus on improving those?

Cheers, Dietrich