Skip to main content

A Python signal processing package for computing spectral-domain and time-domain interactions using the bispectrum.

Project description

PyBispectra logo

A Python signal processing package for computing spectral- and time-domain interactions using the bispectrum.

This package provides the tools for computing phase-amplitude coupling, time delay estimation, and wave shape features using the bispectrum and bicoherence. Additional tools for computing amplitude-amplitude coupling, phase-phase coupling, and spatio-spectral filters are also provided.

Parallel processing and Numba optimisation are implemented to reduce computation times.

Analysis of phase-amplitude coupling, time delays, and non-sinusoidal waveshape provide important insights into electrophysiology data, but traditional analysis methods have critical limitations. In contrast, the bispectrum - the Fourier transform of the third order moment - offers approaches to perform such analyses whilst overcoming many of the limitations of traditional methods.

Installation & Requirements:

Install the package into the desired environment using pip: pip install pybispectra
or conda: conda install -c conda-forge pybispectra
More information on the installation page.

Use:

To get started with the toolbox, check out the documentation and examples.

For instance, given some epoched time series, data, phase-amplitude coupling can be computed as:

from pybispectra import PAC, compute_fft

coeffs, freqs = compute_fft(data, sampling_freq)  # compute spectral coeffs
pac = PAC(coeffs, freqs, sampling_freq)  # initialise coupling object
pac.compute()  # compute phase-amplitude coupling
pac_results = pac.results  # extract results
pac_results.plot()  # plot results

Contributing & Development:

If you encounter issues with the package, want to suggest improvements, or have made any changes which you would like to see officially supported, please refer to the development page. A unit test suite is included and must be expanded where necessary to validate any changes.

Citing:

If you use this toolbox in your work, please include the following citation:
Binns, TS, Pellegrini, F, Jurhar, T, Nguyen, TD, Köhler, RM, & Haufe, S (2025). PyBispectra: A toolbox for advanced electrophysiological signal processing using the bispectrum. Journal of Open Source Software. DOI: 10.21105/joss.08504

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybispectra-1.3.1.tar.gz (14.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybispectra-1.3.1-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

Details for the file pybispectra-1.3.1.tar.gz.

File metadata

  • Download URL: pybispectra-1.3.1.tar.gz
  • Upload date:
  • Size: 14.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybispectra-1.3.1.tar.gz
Algorithm Hash digest
SHA256 02f964282005fbf2b92a4248e1330fc479ca4242174c141100e6e3db9572e92b
MD5 da0db5673e787060a50ef5ed00fbc0b6
BLAKE2b-256 8ae2a80c6aac73176d5943abc1ebd031980abef1242cd9ad9b79c3c923cf37ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybispectra-1.3.1.tar.gz:

Publisher: release.yml on braindatalab/PyBispectra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pybispectra-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: pybispectra-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 61.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pybispectra-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71b35d361d9984f8e483cf82e80729083e2da2891774b48a253793f4d36ee563
MD5 edd93de2f34971100b1832f5821fabad
BLAKE2b-256 8d2c03692b60ba7764fd1d0b10418831535abd809fc0f8ccd41c1297d3411c01

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybispectra-1.3.1-py3-none-any.whl:

Publisher: release.yml on braindatalab/PyBispectra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page