neurokit2
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
Author
Category
Development ToolsInstall
Hot:4
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-neurokit2&locale=en&source=copy
NeuroKit2 - Python Physiological Signal Processing and Biosignal Analysis Toolkit
Overview of Skills
NeuroKit2 is a comprehensive Python toolkit for processing physiological signals such as electrocardiography (ECG), electroencephalography (EEG), electrodermal activity (EDA), respiration (RSP), photoplethysmography (PPG), electromyography (EMG), and electrooculography (EOG). It is suitable for research in psychophysiology, clinical applications, and human-computer interaction studies.
Use Cases
1. Analysis of Psychophysiology Experimental Data
When researchers conduct psychophysiological experiments on emotions, cognition, stress, and more, they need to synchronously acquire and analyze multiple physiological signals. NeuroKit2 can process ECG, EEG, EDA, and respiration signals simultaneously. It automatically selects event-related or interval-related analysis modes, supports resting-state baseline measurement and event-related potential analysis, and helps researchers quantify changes in autonomic nervous system and cardiovascular activity.
2. Clinical Physiological Signal Processing and HRV Analysis
Clinicians and researchers need to assess heart rate variability (HRV), autonomic function, and cardiovascular health indicators. NeuroKit2 provides a complete ECG processing pipeline (signal cleaning → R-peak detection → waveform segmentation → quality assessment), computes comprehensive HRV metrics in the time, frequency, and nonlinear domains, and supports respiratory sinus arrhythmia (RSA) analysis. It is suitable for screening arrhythmias, evaluating stress, and testing autonomic function.
3. Multimodal Physiological Signal Integration and Human-Computer Interaction
In human-computer interaction, affective computing, and biofeedback applications, multiple physiological signals must be processed and integrated in real time. NeuroKit2 supports simultaneous processing of ECG, EEG, EDA, RSP, EMG, and EOG signals, provides a unified output interface, and can compute sympathetic activity indices, signal quality assessment, complexity, and entropy analysis. This makes it suitable for building real-time physiological monitoring systems and adaptive interaction interfaces.
Core Features
1. ECG Signal Processing and Heart Rate Variability Analysis
Provides a complete ECG/PPG processing pipeline, including signal filtering, R-peak detection, waveform segmentation, and quality assessment. Supports computation of comprehensive HRV metrics: time domain (SDNN, RMSSD, pNN50), frequency domain (ULF, VLF, LF, HF, VHF power and ratios), nonlinear domain (Poincaré plot SD1/SD2, entropy measures, fractal dimensions), as well as respiratory sinus arrhythmia (RSA) and recurrence quantification analysis (RQA). Supports two automatic analysis modes: event-related and interval-related.
2. EEG Signal Analysis and Complexity Calculation
Analyzes EEG frequency-band power (Delta, Theta, Alpha, Beta, Gamma), supports channel quality assessment and re-referencing, and provides microstate segmentation and transition dynamics analysis, along with global field power and dissimilarity measures. Includes comprehensive complexity and entropy analysis tools: Shannon entropy, approximate entropy, sample entropy, permutation entropy, spectral entropy, fuzzy entropy, multiscale entropy, and fractal dimensions (Katz, Higuchi, Petrosian, Sevcik), Lyapunov exponents, Lempel-Ziv complexity, and detrended fluctuation analysis (DFA).
3. Multisignal Synchronized Processing and Event-Related Analysis
Supports simultaneous processing of multiple physiological signals (ECG, EEG, EDA, RSP, EMG, EOG) and provides unified
bio_process() and bio_analyze() functions to implement multimodal dataset integration. Event-related analysis features include creating epochs from event markers, event-related averages and visualization, baseline correction options, and grand averaging with confidence intervals. Suitable for stimulus-locked response analysis, supports experimental paradigms with discrete trials and interval analysis for long continuous activities.Frequently Asked Questions
What types of physiological signals does NeuroKit2 support?
NeuroKit2 supports 11 major categories of physiological signal processing: ECG, PPG, HRV, EEG, EDA/GSR (electrodermal activity/skin conductance), respiration signals (RSP), EMG, EOG, general signal processing (filtering, decomposition, peak detection), complexity and entropy analysis, event-related analysis, and multisignal integration processing. It covers multiple physiological systems including cardiovascular, neural, autonomic, respiratory, muscular, and eye movement.
How are HRV metrics calculated?
Use
nk.hrv(peaks, sampling_rate=1000) to compute all HRV metrics at once (time domain, frequency domain, and nonlinear domain). If you only need analysis for a specific domain, use nk.hrv_time(), nk.hrv_frequency(), and nk.hrv_nonlinear() respectively. For respiratory sinus arrhythmia, use nk.hrv_rsa(peaks, rsp_signal, sampling_rate=1000). The complete workflow is: first process the raw ECG signal with nk.ecg_process() to obtain R-peak locations, then pass the peak locations into the HRV calculation function.Can NeuroKit2 handle real-time physiological data?
NeuroKit2 itself is an offline analysis tool, but it can be used as the core component of a real-time processing pipeline. Its
*_process() functions (e.g., ecg_process(), eda_process()) support input of segments of data, which can be called step-by-step in a real-time stream. Features such as signal filtering, peak detection, and quality assessment can all be used for real-time data. For applications requiring strict real-time performance (e.g., biofeedback systems), it is recommended to embed NeuroKit2 into an asynchronous processing framework or use with stream-processing libraries. Suggested sampling rates depend on the signal type: ECG typically 250–1000 Hz, EEG 250–500 Hz, and EDA/RSP 100–250 Hz.