So I have an image like this
Is there any algorithm to extract (get as PCM) sound from which was created that image?
So I have an image like this
Is there any algorithm to extract (get as PCM) sound from which was created that image?
Unfortunately, the resolution of that image is too low to extract useful information. If you had a greatly zoomed-in version you could convert the pixel data back to audio.
Given sufficient precision, I'm quite sure it's possible. However, I believe this wave would be much too imprecise to allow for any good to come out of it.
Basic answer is yes.. sort of. But not from that exact picture. That is because that picture is an extremely time-compressed waveform of the sound. There are likely sound waves missing in that picture hidden between 1 pixel and the next.
In case you're wondering the algorithm is:
sound_amplitude=((pixel_height-(image_height/2))/image_height)*sound_resolution
where sound_resolution is 128 if 8 bit and 32768 if 16 bit.
But, as I said, that image is too compressed. You have multiple pixels squished into a single vertical line. You can't correctly extract pixel_height form that.
To completely recover 1 second of sound at a sampling rate of, say, 44100 Hz; you need to zoom the drawing to be 44100 pixels (approx 40 screens) width.
You would need to zoom in close enough to see the actual waveform, like this: