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.2.4.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.4-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pybispectra-1.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 54326457d3c339833dc7fb8c225d68923c20766be36a0af923527a7998206970
MD5 fbdcc010f895f9d468ec1a22d1adb1b1
BLAKE2b-256 cd539f22b97eb844431557ae97f81898e29619aaabc2c1921193423bc457dd4c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pybispectra-1.2.4-py3-none-any.whl
  • Upload date:
  • Size: 57.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 15fc85b1ef02a46e343003307e1055dbfbf80a3547cf27e76d0fc074d44057f2
MD5 38c02a53494806d0583350bd61f72095
BLAKE2b-256 76654eee2801f393cef9357a28ea330f5699bdb1c22094f18ac11ec969776a68

See more details on using hashes here.

Provenance

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