renatosc / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing

Home Page:https://neurokit2.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https://raw.github.com/neuropsychology/NeuroKit/master/docs/img/banner.png https://img.shields.io/pypi/dm/neurokit2 Maintainability

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!

Installation

To install NeuroKit, run this command in your terminal:

pip install https://github.com/neuropsychology/neurokit/zipball/master

Contribution

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.

Documentation

Documentation Status API Tutorials

Click on the links above and check out our tutorials:

Examples

Simulate physiological signals

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))

https://raw.github.com/neuropsychology/NeuroKit/master/docs/img/README_simulation.png

Respiration (RSP) processing

# 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)

https://raw.github.com/neuropsychology/NeuroKit/master/docs/img/README_respiration.png

Signal processing

Signal cleaning

  • 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 preprocessing

Signal processing

  • 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.

Other Utilities

Read data

  • read_acqknowledge(): Read and format a BIOPAC’s AcqKnowledge file into a pandas’ dataframe.

Events (stimuli triggers and markers)

Alternatives

Here's a list of great alternative packages that you should check-out:

General

ECG

EDA

EEG

Eye-Tracking

About

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing

https://neurokit2.readthedocs.io/

License:MIT License


Languages

Language:Python 100.0%