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()
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)
| File | Size | Uploaded | |
|---|---|---|---|
| tensorpac-0.6.5.tar.gz | 388.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|