Skip to main content
https://github.com/EtienneCmb/tensorpac/workflows/Tensorpac/badge.svg https://travis-ci.org/EtienneCmb/tensorpac.svg?branch=master https://circleci.com/gh/EtienneCmb/tensorpac/tree/master.svg?style=svg https://ci.appveyor.com/api/projects/status/0arxtw05583gc3e2/branch/master?svg=true https://codecov.io/gh/EtienneCmb/tensorpac/branch/master/graph/badge.svg https://badge.fury.io/py/tensorpac.svg https://pepy.tech/badge/tensorpac https://badges.gitter.im/EtienneCmb/tensorpac.svg
https://github.com/EtienneCmb/tensorpac/blob/master/docs/source/picture/tp.png

Description

Tensorpac is an Python open-source toolbox for computing Phase-Amplitude Coupling (PAC) using tensors and parallel computing for an efficient, and highly flexible modular implementation of PAC metrics both known and novel. Check out our documentation for details.

Installation

Tensorpac uses NumPy, SciPy and joblib for parallel computing. To get started, just open your terminal and run :

$ pip install tensorpac

Code snippet & illustration

from tensorpac import Pac
from tensorpac.signals import pac_signals_tort

# Dataset of signals artificially coupled between 10hz and 100hz :
n_epochs = 20   # number of trials
n_times = 4000  # number of time points
sf = 512.       # sampling frequency

# Create artificially coupled signals using Tort method :
data, time = pac_signals_tort(f_pha=10, f_amp=100, noise=2, n_epochs=n_epochs,
                              dpha=10, damp=10, sf=sf, n_times=n_times)

# Define a Pac object
p = Pac(idpac=(6, 0, 0), f_pha='hres', f_amp='hres')
# Filter the data and extract pac
xpac = p.filterfit(sf, data)

# plot your Phase-Amplitude Coupling :
p.comodulogram(xpac.mean(-1), cmap='Spectral_r', plotas='contour', ncontours=5,
               title=r'10hz phase$\Leftrightarrow$100Hz amplitude coupling',
               fz_title=14, fz_labels=13)

p.show()
https://github.com/EtienneCmb/tensorpac/blob/master/docs/source/picture/readme.png

Metadata

Release files for tensorpac 0.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensorpac 0.6.5
File Size Uploaded
tensorpac-0.6.5.tar.gz 388.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tensorpac 0.6.5
File Interpreter ABI Platform
tensorpac-0.6.5-py3-none-any.whl Python 3 none any Details

Total release size: 811.7 kB

Release files / tensorpac-0.6.5.tar.gz

Download URL tensorpac-0.6.5.tar.gz
Size 388.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a23511f13a38464a428504f890377b8664145b7c094dd5faa0adeb1fddfde248
BLAKE2b-256 checksum
How to use checksums
344cb7cab0522f4e9601a7e44d14d250801267d20848498426da875f53896bab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release files / tensorpac-0.6.5-py3-none-any.whl

Download URL tensorpac-0.6.5-py3-none-any.whl
Size 423.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
579d65a0ba85400886dcf4074d5704d334ec9543bcf2d8cd2a6d9f63f37e57d0
BLAKE2b-256 checksum
How to use checksums
4a748818a87c860f24dff6f22032cf3a6464d9aa7875db474fa676df0d919682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200712 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8

Release history Release notifications | RSS feed

This release

0.6.5 This release

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

3 release files

0.5.6

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page