Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simulator of realistic ECG signal from rr data for matlab or python

I have a series of rr data (distances between r-r peak in PQRST electrocardiogramm signal) and I want to generate realistic ECG signal in matlab or python. I've found some materials for matlab (ecg built-in function in matlab) but I can't figure out how to generate it from rr data, and I've found nothing for python. Any advice?

like image 562
nkint Avatar asked Dec 08 '10 13:12

nkint


People also ask

What is ECG Simulator?

The ECG (electrocardiogram) Simulator is an electronic tool that provides cardiac monitors with an electrical wave similar to the human heart's signal. It can be used to teach healthcare personnel how to set up the input parameters for ECG machines.

How are ECG signals processed?

ECG signal processing techniques consists of, de-noising, baseline correction, parameter extraction and arrhythmia detection. An ECG waveform consists of five basic waves P, Q, R, S, and T waves and sometimes U waves.


1 Answers

Does this suit your needs? If not, please let me know. Good luck.

import scipy
import scipy.signal as sig
rr = [1.0, 1.0, 0.5, 1.5, 1.0, 1.0] # rr time in seconds
fs = 8000.0 # sampling rate
pqrst = sig.wavelets.daub(10) # just to simulate a signal, whatever
ecg = scipy.concatenate([sig.resample(pqrst, int(r*fs)) for r in rr])
t = scipy.arange(len(ecg))/fs
pylab.plot(t, ecg)
pylab.show()

ECG signal

like image 110
Steve Tjoa Avatar answered Nov 03 '22 11:11

Steve Tjoa