The Python Toolbox for Neurophysiological Signal Processing (EDA, ECG, PPG, EMG, EEG...)
This is a work in progress project meant as a continuation of NeuroKit.py. We are looking to build a community of people around this collaborative project. If you're interested by getting involved, do let us know!
To install NeuroKit, run this command in your terminal:
pip install https://github.com/neuropsychology/neurokit/zipball/master
NeuroKit2 is meant to be a all-level-friendly collaborative project. Plus, it tries to credit all contributions and contributors, so that your involvement pays off also on your CV. Thus, if you have some ideas for improvement, new features, or just wanna learn Python and do something useful at the same time, do not hesitate and check-out the CONTRIBUTION GUIDE.
Click on the links above and check out our tutorials:
import numpy as np
import pandas as pd
import neurokit2 as nk
# Generate synthetic signals
ecg = nk.ecg_simulate(duration=10, heart_rate=70)
rsp = nk.rsp_simulate(duration=10, respiratory_rate=15)
eda = nk.eda_simulate(duration=10, n_scr=3)
emg = nk.emg_simulate(duration=10, n_bursts=2)
# Visualise biosignals
data = pd.DataFrame({"ECG": ecg,
"RSP": rsp,
"EDA": eda,
"EMG": emg})
data.plot(subplots=True, layout=(4, 1))
# Generate one minute of respiratory signal
rsp = nk.rsp_simulate(duration=60, respiratory_rate=15)
# Process it
signals, info = nk.rsp_process(rsp)
# Visualise the processing
nk.rsp_plot(signals)
- signal_distord(): Add noise of a given frequency, amplitude and shape to a signal.
- signal_binarize(): Convert a continuous signal into zeros and ones depending on a given threshold.
- signal_filter(): Apply a lowpass, highpass or bandpass filter to the signal.
- signal_detrend(): Apply a baseline (order = 0), linear (order = 1), or polynomial (order > 1) detrending to the signal (i.e., removing a general trend).
- signal_smooth(): Signal smoothing using the convolution of a filter kernel.
- signal_resample(): Up- or down-sample a signal.
- signal_interpolate(): Interpolate (fills the values between data points) a signal using different methods.
- signal_merge(): Arbitrary addition of two signals with different time ranges.
- signal_zerocrossings(): Locate the indices where the signal crosses zero.
- signal_findpeaks(): Locate peaks (local maxima) in a signal and their related characteristics, such as height (prominence), width and distance with other peaks.
- signal_plot(): Plot signal with events as vertical lines.
- read_acqknowledge(): Read and format a BIOPAC’s AcqKnowledge file into a pandas’ dataframe.
- events_find(): Find and select events in a continuous signal (e.g., from a photosensor).
- events_plot(): Plot events in signal.
- events_to_mne(): Create MNE compatible events for integration with M/EEG.
Here's a list of great alternative packages that you should check-out:
- eda-explorer
- cvxEDA
- Pypsy
- BreatheEasyEDA (matlab)
- EDA (matlab)