All Projects → raphaelvallat → antropy

raphaelvallat / antropy

Licence: BSD-3-Clause license
AntroPy: entropy and complexity of (EEG) time-series in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to antropy

Entropy
EntroPy: complexity of time-series in Python (DEPRECATED)
Stars: ✭ 142 (+27.93%)
Mutual labels:  signal-processing, neuroscience, eeg
Neurokit
NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
Stars: ✭ 264 (+137.84%)
Mutual labels:  signal-processing, eeg, signal
Mne Cpp
MNE-CPP: A Framework for Electrophysiology
Stars: ✭ 104 (-6.31%)
Mutual labels:  signal-processing, neuroscience, eeg
Brainflow
BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors
Stars: ✭ 170 (+53.15%)
Mutual labels:  signal-processing, neuroscience, eeg
python-meegkit
🔧🧠 MEEGkit: MEG & EEG processing toolkit in Python 🧠🔧
Stars: ✭ 99 (-10.81%)
Mutual labels:  signal-processing, neuroscience, eeg
pyRiemann
Python machine learning package based on sklearn API for multivariate data processing and statistical analysis of symmetric positive definite matrices via Riemannian geometry
Stars: ✭ 470 (+323.42%)
Mutual labels:  signal-processing, neuroscience, eeg
Wits
A Node.js library that reads your mind with Emotiv EPOC EEG headset
Stars: ✭ 73 (-34.23%)
Mutual labels:  signal-processing, eeg
Edsp
A cross-platform DSP library written in C++ 11/14. This library harnesses the power of C++ templates to implement a complete set of DSP algorithms.
Stars: ✭ 116 (+4.5%)
Mutual labels:  signal-processing, signal
Bci.js
📊 EEG signal processing and machine learning in JavaScript
Stars: ✭ 117 (+5.41%)
Mutual labels:  signal-processing, eeg
Signals And Systems Lecture
Continuous- and Discrete-Time Signals and Systems - Theory and Computational Examples
Stars: ✭ 166 (+49.55%)
Mutual labels:  signal-processing, signal
Stocks
Programs for stock prediction and evaluation
Stars: ✭ 155 (+39.64%)
Mutual labels:  signal-processing, signal
bob
Bob is a free signal-processing and machine learning toolbox originally developed by the Biometrics group at Idiap Research Institute, in Switzerland. - Mirrored from https://gitlab.idiap.ch/bob/bob
Stars: ✭ 38 (-65.77%)
Mutual labels:  signal-processing, feature-extraction
Strugatzki
Algorithms for matching audio file similarities. Mirror of https://git.iem.at/sciss/Strugatzki
Stars: ✭ 38 (-65.77%)
Mutual labels:  signal-processing, feature-extraction
Surfboard
Novoic's audio feature extraction library
Stars: ✭ 318 (+186.49%)
Mutual labels:  signal-processing, feature-extraction
brain-monitor
A terminal app written in Node.js to monitor brain signals in real-time
Stars: ✭ 119 (+7.21%)
Mutual labels:  signal-processing, eeg
qEEG feature set
NEURAL: a neonatal EEG feature set in Matlab
Stars: ✭ 29 (-73.87%)
Mutual labels:  signal-processing, eeg
DTMF-Decoder
A Java program to implement a DMTF Decoder.
Stars: ✭ 28 (-74.77%)
Mutual labels:  signal-processing, signal
tmo-live-graph
A simpe react app that plots a live view of the T-Mobile Home Internet Nokia 5G Gateway signal stats, helpful for optimizing signal.
Stars: ✭ 15 (-86.49%)
Mutual labels:  signal-processing, signal
FftSharp
A .NET Standard library for computing the Fast Fourier Transform (FFT) of real or complex data
Stars: ✭ 132 (+18.92%)
Mutual labels:  signal-processing, signal
mne-bids
MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
Stars: ✭ 88 (-20.72%)
Mutual labels:  neuroscience, eeg

https://travis-ci.org/raphaelvallat/antropy.svg?branch=master
https://github.com/raphaelvallat/antropy/blob/master/docs/pictures/logo.png?raw=true

AntroPy is a Python 3 package providing several time-efficient algorithms for computing the complexity of time-series. It can be used for example to extract features from EEG signals.

Documentation

Installation

pip install antropy

Dependencies

Functions

Entropy

import numpy as np
import antropy as ant
np.random.seed(1234567)
x = np.random.normal(size=3000)
# Permutation entropy
print(ant.perm_entropy(x, normalize=True))
# Spectral entropy
print(ant.spectral_entropy(x, sf=100, method='welch', normalize=True))
# Singular value decomposition entropy
print(ant.svd_entropy(x, normalize=True))
# Approximate entropy
print(ant.app_entropy(x))
# Sample entropy
print(ant.sample_entropy(x))
# Hjorth mobility and complexity
print(ant.hjorth_params(x))
# Number of zero-crossings
print(ant.num_zerocross(x))
# Lempel-Ziv complexity
print(ant.lziv_complexity('01111000011001', normalize=True))
0.9995371694290871
0.9940882825422431
0.9999110978316078
2.015221318528564
2.198595813245399
(1.4313385010057378, 1.215335712274099)
1531
1.3597696150205727

Fractal dimension

# Petrosian fractal dimension
print(ant.petrosian_fd(x))
# Katz fractal dimension
print(ant.katz_fd(x))
# Higuchi fractal dimension
print(ant.higuchi_fd(x))
# Detrended fluctuation analysis
print(ant.detrended_fluctuation(x))
1.0310643385753608
5.954272156665926
2.005040632258251
0.47903505674073327

Execution time

Here are some benchmarks computed on a MacBook Pro (2020).

import numpy as np
import antropy as ant
np.random.seed(1234567)
x = np.random.rand(1000)
# Entropy
%timeit ant.perm_entropy(x)
%timeit ant.spectral_entropy(x, sf=100)
%timeit ant.svd_entropy(x)
%timeit ant.app_entropy(x)  # Slow
%timeit ant.sample_entropy(x)  # Numba
# Fractal dimension
%timeit ant.petrosian_fd(x)
%timeit ant.katz_fd(x)
%timeit ant.higuchi_fd(x) # Numba
%timeit ant.detrended_fluctuation(x) # Numba
106 µs ± 5.49 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
138 µs ± 3.53 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
40.7 µs ± 303 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
2.44 ms ± 134 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
2.21 ms ± 35.4 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
23.5 µs ± 695 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
40.1 µs ± 2.09 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
13.7 µs ± 251 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
315 µs ± 10.7 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

Development

AntroPy was created and is maintained by Raphael Vallat. Contributions are more than welcome so feel free to contact me, open an issue or submit a pull request!

To see the code or report a bug, please visit the GitHub repository.

Note that this program is provided with NO WARRANTY OF ANY KIND. Always double check the results.

Acknowledgement

Several functions of AntroPy were adapted from:

All the credit goes to the author of these excellent packages.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].