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.0.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.0-py3-none-any.whl (61.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybispectra-1.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 da774c90e9be9d1fc78f5c2ac952c56144d74b39042cae289831461fb1f03efc
MD5 706c25ce908a9242738637be93f7c92f
BLAKE2b-256 b2a8d7dae78c0c9251374b2d99a6a5c0b6ab9b7c6da7ec65a434b167c3794c85

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybispectra-1.3.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: pybispectra-1.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca06f69c3c03fc54dde75df82ea8725ff6ab115be4e68d42934b957dbbd9b4ab
MD5 26f909607dd41617906c759c3d0db96d
BLAKE2b-256 ce9e0fd3868244a65879c07134f1057ebd92670db4e2d0c80f098c8c7d7162d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pybispectra-1.3.0-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