Back to Blog

Simulating Human Physiology: QevosAgent Explores ECG and Heart Rate Variability with NeuroKit2

Date: 2026-05-08
Tags: NeuroKit2, ECG, HRV, Biology Simulation, Physiological Signals, Python, Open Source


The Challenge

Can an AI agent independently conduct biological research? Not just run a pre-written script, but discover tools, set up experiments, generate synthetic data, extract meaningful features, and interpret the results in a clinical context?

This is exactly what QevosAgent did when asked to "demonstrate biology research and simulation capabilities."

The Tool: NeuroKit2

After surveying the landscape of open-source physiological signal processing libraries, QvosAgent selected NeuroKit2 (v0.2.13) — a comprehensive Python toolkit from the Neuropsychology Lab at the University of Sussex.

NeuroKit2 supports:

Its feature extraction pipeline alone produces 79+ Heart Rate Variability (HRV) metrics spanning time-domain, frequency-domain, non-linear, and entropy-based analyses.

The Experiment

Signal Generation

QvosAgent generated synthetic physiological signals with clinically realistic parameters:

Parameter Value
ECG Heart Rate 70 BPM
Signal Duration 10 seconds
Sampling Rate 1000 Hz
Breathing Rate 15 breaths/min

Three signal types were generated simultaneously:

  1. ECG — synthetic electrocardiogram with characteristic P-QRS-T waveforms
  2. PPG — photoplethysmography (the same principle as your smartwatch's heart rate sensor)
  3. Respiration — sinusoidal breathing waveform at 0.25 Hz

Signal Processing Pipeline

The complete pipeline executed automatically:

  1. Signal Generation → Create synthetic ECG, PPG, and respiration signals
  2. Preprocessing → Denoising, filtering, and baseline correction
  3. Peak Detection → Identify R-peaks in ECG (11 detected) and pulse peaks in PPG (10 detected)
  4. RR Interval Extraction → Calculate inter-beat intervals from consecutive R-peaks
  5. Feature Extraction → Compute 79 HRV features across multiple analytical domains
  6. Visualization → Generate multi-panel signal plots, feature bar charts, and Poincaré scatter plots

Key Results

ECG Analysis

HRV Highlights

Metric Value Clinical Significance
SDNN 11.51 ms Overall autonomic nervous system regulation
RMSSD 13.19 ms Parasympathetic (vagal) activity
pNN20 10.0% Proportion of successive RR differences > 20ms
SD1 (Poincaré) 9.72 ms Short-term HRV
SD2 (Poincaré) 12.08 ms Long-term HRV
Shannon Entropy 3.32 Complexity/unpredictability of heart rate

Note: These values are from a 10-second synthetic recording. Clinical 24-hour Holter monitors typically show SDNN of 50-100 ms. Short recordings naturally yield lower values, which is expected.

Visualizations

Physiological Signals Multi-panel visualization of ECG (with R-peaks), PPG (with pulse peaks), respiration, and instantaneous heart rate

HRV Features Key HRV metrics across time-domain, frequency-domain, and non-linear analyses

Poincaré Plot Poincaré scatter plot showing the relationship between consecutive RR intervals — a classic non-linear HRV visualization

Why This Matters

For AI Agents

This experiment demonstrates that QvosAgent can:

For Biomedical Research

HRV analysis is a cornerstone of:

The ability to automate this entire workflow — from raw signal to clinical features — opens doors for rapid prototyping of biomedical signal processing pipelines.

What's Next

Synthetic data is a great starting point, but real physiological signals tell a richer story. In a follow-up experiment, QvosAgent analyzed real ECG recordings from the MIT-BIH Arrhythmia Database, comparing normal sinus rhythm against ventricular premature beats. The results revealed dramatic differences in HRV metrics that mirror clinical findings — more on that in the next post.


This experiment was conducted entirely autonomously by QvosAgent, a local, open-source AI agent that runs on your own machine.