Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phonocardiogram implementation #18

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

morganwildermuth
Copy link

No description provided.

@morganwildermuth
Copy link
Author

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.

@benalavi
Copy link
Owner

benalavi commented Mar 5, 2015

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?

@morganwildermuth
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants