Steve Thoa's answer gave me a very good basis for writing the following script. This is very similar, except that I ripped out some lines of code to make it more readable for n00bs, like me. I also added a longer rest period for the heart to give a slightly more accurate replication. The script allows you to set the following: bpm heart rate, capture time, added noise, adc resolution and adc sample rate. I would recommend installing anaconda to run it. It will install the necessary libraries and provide you with an excellent ID Spyder environment to run it.

import pylab import scipy.signal as signal import numpy print('Simulating heart ecg')
source share