Friday 6 April 2012

Heart beat to midi, take 2

EDIT: This project actually finished up sometime in 2013. There is now a project page at http://foulab.org/en/user/strawdog/HeartBeat, complete with a link to video of the device in action. You may want to go there directly.

So it took about a month to get organized again, and once again David did most of the work for us.  It turns out the inventor of Exerlopers pulse monitoring equipment lives in Montreal.  He quickly turned around a customized version of their pulse detector that outputs a 5v signal when the heart beat is detected.

Gapzap had actually constructed an EKG on himself.  In that experiment, he had found that the myoelectric signals interfered a lot with the heart rate.  In the patent for this pulse detector, theres a lot of discussion about filtering those signals.  Originally, Gapzap found this other patent... looks like a bit of overlap.  But I digress.

Anyway, the pulse detector seems pretty good at first view.  Construction is solid, and it responds well to anyone who picks it up to use it.  Heres a shot of the version 1 pulse to midi hooked to the new sensor.

So - its time to analyse whats coming out of it.  I wrote a quick Arduino program to get the pulse timing as precisely as possible. (The code is up on github, here.) And I gathered a couple minutes of data to take a look at.  The first few samples, as i was grabbing on to the sensor, and the last sample as I let go were outliers.  But the middle part was pretty consistent.  Heres a histogram:

Bottom scale is microseconds.  It seemed unlikely that just going direct to midi is a good idea - the small irregularities in the heartbeat will be quite jarring to the ear.  And, in fact, that was the case.  Heres a sound sample:


So, not quite done yet, time to break out some filtering algorithms.

No comments:

Post a Comment