Suggestions for realistic heart beat effect

I’m trying (without success) to create the effect of a heart monitor machine using a/s (think of the electronic machine with black background and green line that peaks with each beat of the heart) but not having much success … mainly as I’m trying to use the drawing API and don’t have much experience with it. I’m using a/s rather than using mcs as I wanted the beats to fluctuate a little … maybe even with a bit of sudden peaks and flat-lining in there!
Anyone got an suggestions on how I might be able to go about this?
Thanks

Tom