SkillAgentSearch skills...

NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing

Install / Use

/learn @neuropsychology/NeuroKit

README

.. image:: https://raw.github.com/neuropsychology/NeuroKit/master/docs/img/banner.png :target: https://neuropsychology.github.io/NeuroKit/

.. image:: https://img.shields.io/pypi/pyversions/neurokit2.svg?logo=python&logoColor=FFE873 :target: https://pypi.python.org/pypi/neurokit2

.. image:: https://img.shields.io/pypi/dm/neurokit2 :target: https://pypi.python.org/pypi/neurokit2

.. image:: https://img.shields.io/pypi/v/neurokit2.svg?logo=pypi&logoColor=FFE873 :target: https://pypi.python.org/pypi/neurokit2

.. image:: https://github.com/neuropsychology/NeuroKit/actions/workflows/tests.yml/badge.svg :target: https://github.com/neuropsychology/NeuroKit/actions/workflows/tests.yml

.. image:: https://codecov.io/gh/neuropsychology/NeuroKit/branch/master/graph/badge.svg :target: https://codecov.io/gh/neuropsychology/NeuroKit

The Python Toolbox for Neurophysiological Signal Processing

NeuroKit2 is a user-friendly package providing easy access to advanced biosignal processing routines. Researchers and clinicians without extensive knowledge of programming or biomedical signal processing can analyze physiological data with only two lines of code.

Quick Example

.. code-block:: python

import neurokit2 as nk

# Download example data
data = nk.data("bio_eventrelated_100hz")

# Preprocess the data (filter, find peaks, etc.)
processed_data, info = nk.bio_process(ecg=data["ECG"], rsp=data["RSP"], eda=data["EDA"], sampling_rate=100)

# Compute relevant features
results = nk.bio_analyze(processed_data, sampling_rate=100)

And boom 💥 your analysis is done 😎

Download

You can download NeuroKit2 from PyPI <https://pypi.org/project/neurokit2/>_

.. code-block::

pip install neurokit2

or conda-forge <https://anaconda.org/conda-forge/neurokit2>_

.. code-block::

conda install -c conda-forge neurokit2

If you're not sure what to do, read our installation guide <https://neuropsychology.github.io/NeuroKit/installation.html>_.

Contributing

.. image:: https://img.shields.io/badge/License-MIT-blue.svg :target: https://github.com/neuropsychology/NeuroKit/blob/master/LICENSE :alt: License

.. image:: https://github.com/neuropsychology/neurokit/workflows/%E2%9C%A8%20Style/badge.svg?branch=master :target: https://github.com/neuropsychology/NeuroKit/actions :alt: GitHub CI

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black :alt: Black code

NeuroKit2 is the most welcoming <https://github.com/neuropsychology/NeuroKit#popularity>_ project with a large community of contributors with all levels of programming expertise. But the package is still far from being perfect! Thus, if you have some ideas for improvement, new features, or just want to learn Python and do something useful at the same time, do not hesitate and check out the following guide:

  • Contributing to NeuroKit <https://neuropsychology.github.io/NeuroKit/resources/contributing.html>_

Also, if you have developed new signal processing methods or algorithms and you want to increase their usage, popularity, and citations, get in touch with us to eventually add them to NeuroKit. A great opportunity for the users as well as the original developers!

You have spotted a mistake? An error in a formula or code? OR there is just a step that seems strange and you don't understand? Please let us know! We are human beings, and we'll appreciate any inquiry.

Documentation

.. image:: https://img.shields.io/badge/documentation-online-brightgreen.svg :target: https://neuropsychology.github.io/NeuroKit/ :alt: Documentation Status

.. image:: https://img.shields.io/badge/functions-API-orange.svg?colorB=2196F3 :target: https://neuropsychology.github.io/NeuroKit/functions/index.html :alt: API

.. image:: https://img.shields.io/badge/tutorials-examples-orange.svg?colorB=E91E63 :target: https://neuropsychology.github.io/NeuroKit/examples/index.html :alt: Tutorials

.. .. image:: https://img.shields.io/badge/documentation-pdf-purple.svg?colorB=FF9800 .. :target: https://neurokit2.readthedocs.io/_/downloads/en/latest/pdf/ .. :alt: PDF

.. .. image:: https://mybinder.org/badge_logo.svg .. :target: https://mybinder.org/v2/gh/neuropsychology/NeuroKit/dev?urlpath=lab%2Ftree%2Fdocs%2Fexamples .. :alt: Binder

.. .. image:: https://img.shields.io/gitter/room/neuropsychology/NeuroKit.js.svg .. :target: https://gitter.im/NeuroKit/community .. :alt: Chat on Gitter

Click on the links above and check out our tutorials:

General ^^^^^^^^^^

  • Get familiar with Python in 10 minutes <https://neuropsychology.github.io/NeuroKit/resources/learn_python.html>_
  • Recording good quality signals <https://neuropsychology.github.io/NeuroKit/resources/recording.html>_
  • Install Python and NeuroKit <https://neuropsychology.github.io/NeuroKit/installation.html>_
  • Included datasets <https://neuropsychology.github.io/NeuroKit/functions/data.html#datasets>_
  • Additional Resources <https://neuropsychology.github.io/NeuroKit/resources/resources.html>_

Examples ^^^^^^^^^^

  • Simulate Artificial Physiological Signals <https://neuropsychology.github.io/NeuroKit/examples/signal_simulation/signal_simulation.html>_
  • Customize your Processing Pipeline <https://neuropsychology.github.io/NeuroKit/examples/bio_custom/bio_custom.html>_
  • Event-related Analysis <https://neuropsychology.github.io/NeuroKit/examples/bio_eventrelated/bio_eventrelated.html>_
  • Interval-related Analysis <https://neuropsychology.github.io/NeuroKit/examples/bio_intervalrelated/bio_intervalrelated.html>_
  • Analyze Electrodermal Activity (EDA) <https://neuropsychology.github.io/NeuroKit/examples/eda_peaks/eda_peaks.html>_
  • Analyze Respiratory Rate Variability (RRV) <https://neuropsychology.github.io/NeuroKit/examples/rsp_rrv/rsp_rrv.html>_
  • Extract and Visualize Individual Heartbeats <https://neuropsychology.github.io/NeuroKit/examples/ecg_heartbeats/ecg_heartbeats.html>_
  • Locate P, Q, S, and T waves in ECG <https://neuropsychology.github.io/NeuroKit/examples/ecg_delineate/ecg_delineate.html>_
  • Analyze Electrooculography EOG data <https://neuropsychology.github.io/NeuroKit/examples/eog_analyze/eog_analyze.html>_

.. You can try out these examples directly in your browser <https://github.com/neuropsychology/NeuroKit/tree/master/docs/examples#cloud-based-interactive-examples>_.

Don't know which tutorial is suited for your case? Follow this flowchart:

.. image:: https://raw.github.com/neuropsychology/NeuroKit/master/docs/readme/workflow.png :target: https://neuropsychology.github.io/NeuroKit/

Citation

.. image:: https://zenodo.org/badge/218212111.svg :target: https://zenodo.org/badge/latestdoi/218212111

.. image:: https://img.shields.io/badge/details-authors-purple.svg?colorB=9C27B0 :target: https://neuropsychology.github.io/NeuroKit/authors.html

The NeuroKit2 paper can be found here <https://doi.org/10.3758/s13428-020-01516-y>_ 🎉 Additionally, you can get the reference directly from Python by running:

.. code-block:: python

nk.cite()

.. code-block:: tex

You can cite NeuroKit2 as follows:

- Makowski, D., Pham, T., Lau, Z. J., Brammer, J. C., Lespinasse, F., Pham, H.,
Schölzel, C., & Chen, S. A. (2021). NeuroKit2: A Python toolbox for neurophysiological signal processing.
Behavior Research Methods, 53(4), 1689–1696. https://doi.org/10.3758/s13428-020-01516-y

Full bibtex reference:

@article{Makowski2021neurokit,
    author = {Dominique Makowski and Tam Pham and Zen J. Lau and Jan C. Brammer and Fran{\c{c}}ois Lespinasse and Hung Pham and Christopher Schölzel and S. H. Annabel Chen},
    title = {{NeuroKit}2: A Python toolbox for neurophysiological signal processing},
    journal = {Behavior Research Methods},
    volume = {53},
    number = {4},
    pages = {1689--1696},
    publisher = {Springer Science and Business Media {LLC}},
    doi = {10.3758/s13428-020-01516-y},
    url = {https://doi.org/10.3758%2Fs13428-020-01516-y},
    year = 2021,
    month = {feb}
}

Let us know if you used NeuroKit2 in a publication! Open a new discussion <https://github.com/neuropsychology/NeuroKit/discussions>_ (select the NK in publications category) and link the paper. The community would be happy to know about how you used it and learn about your research. We could also feature it once we have a section on the website for papers that used the software.

.. Design --------

*NeuroKit2* is designed to provide a **consistent**, **accessible** yet **powerful** and **flexible** API.

- **Consistency**: For each type of signals (ECG, RSP, EDA, EMG...), the same function names are called (in the form :code:`signaltype_functiongoal()`) to achieve equivalent goals, such as :code:`*_clean()`, :code:`*_findpeaks()`, :code:`*_process()`, :code:`*_plot()` (replace the star with the signal type, e.g., :code:`ecg_clean()`).
- **Accessibility**: Using NeuroKit2 is made very easy for beginners through the existence of powerful high-level "master" functions, such as :code:`*_process()`, that performs cleaning, preprocessing and processing with sensible defaults.
- **Flexibility**: However, advanced users can very easily build their own custom analysis pipeline by using the mid-level functions (such as :code:`*_clean()`, :code:`*_rate()`), offering more control and flexibility over their parameters.

Physiological Data Preprocessing

Simulate physiological signals ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can easily simulate artificial ECG (also `12-Lead multic

Related Skills

View on GitHub
GitHub Stars2.2k
CategoryEducation
Updated42m ago
Forks512

Languages

Python

Security Score

100/100

Audited on Mar 20, 2026

No findings