Note: this is a copy of ENH: Function for bicoherence · Issue #23054 · scipy/scipy , opened here following request from scipy maintainers .
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.:
- https://stackoverflow.com/questions/4194554/function-for-computing-bicoherence
- GitHub - trichter/polycoherence: Calculate bicoherence, bispectrum, polycoherence and polyspectrum
- GitHub - braindatalab/PyBispectra: A Python signal analysis toolbox for computing spectral-domain interactions using the bispectrum.
- (disclaimer: this is the verbose one I wrote for wrapping my mind around it; if this can help, it would be fine to me to pull and refactor it to scipy): tutorials/Bicoherence/bicoherence.py at main · jerabaul29/tutorials · GitHub