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
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.2.3.tar.gz (14.4 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.2.3-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pybispectra-1.2.3.tar.gz
Algorithm Hash digest
SHA256 c38c2b2b1dc73bb5d789db87869e6b288f0b7c50c0d3c9b8725d8ace4f5cebf4
MD5 f49e81fcfe169f00d727d3b0f022d36c
BLAKE2b-256 c688afe8ccbbdefb25d26410a9c9e504badf4a5b55bad776e6b79f5f4dfdf841

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybispectra-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 57.4 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.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d9be4324a90f6a9239dd7361636e5c23f0db96dd6af53f711d76ccad9c454dc0
MD5 4c49f132b4aa8932e99eb8a51c056b42
BLAKE2b-256 55e6522dfe454156cc08dc7a83ed8ae023114de9e375791827c289f023949951

See more details on using hashes here.

Provenance

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