waveform icon indicating copy to clipboard operation
waveform copied to clipboard

Phonocardiogram implementation

Open morganwildermuth opened this issue 9 years ago • 3 comments

morganwildermuth avatar Mar 02 '15 21:03 morganwildermuth

Added ability to add phonocardiogram wave forms + ability to indicate your own samples rather than letting the gem analyze the audio and generate the samples itself. Necessary for my own project, so thought I'd push up in case it helped someone else.

morganwildermuth avatar Mar 02 '15 21:03 morganwildermuth

Thanks for the patch!

I'm a little swamped right now but will look at it in more depth soon. At first glance I think the option to generate a phonocardiogram might be a specific to be included in a more general waveform generator, but I'm curious if taking it in a more general direction would work.

For instance: would adding an option to draw the waveform from the bottom up (instead of from the middle out) effectively generate a phonocardiogram as well?

benalavi avatar Mar 05 '15 08:03 benalavi

Thanks for taking a look :)

A more general implementation is difficult because two things are happening to generate the phonocardiogram. First, the samples taken switch from absolute value to just their value. Second, the waveform is drawn differently. The audio version creates vertical lines right next to each other in order to create the 'filled in' impression and uses the absolute points of the sampling to figure out the length of that specific line. In contrast, the phonocardiogram wave drawing is basically just a line graph implementation.

I did struggle a bit trying to distinguish effectively between -s (where you are getting samples: from audio or passed in values) and -m (if you're sampling from the audio, how you're sampling).

Love to hear any further feedback you have when you have the time; I might have misunderstood what drawing from the bottom up means but what I'm envisioning wouldn't solve the issue.

morganwildermuth avatar Mar 05 '15 17:03 morganwildermuth