Electronics > Beginners
how do you interpret the raw data of a WAV file?
(1/2) > >>
engineheat:
I'm trying to do some signal processing on a WAV file. The data is just an array of integers, with some as high as 20000. I believe each data point is 16 bit and I get the concept of bit depth.

But I still struggle to understand the "unit" of that amplitude. I get that amplitude is a measure of the intensity of the sound and that sound is a pressure wave. Is it 20000 what?

Is this number arbitrary? What if I halved all the data by multiplying by 0.5, I frequency spectrum will be the same but the magnitude at the frequencies will be halved as well. Will the sound be half as loud then?

Thanks
ataradov:
It is exactly like you described. It will have half the amplitude, but the spectrum will remain the same. With 16 bits you should see numbers in the range -23768 - 32767.
amyk:

--- Quote from: engineheat on January 09, 2019, 01:06:24 am ---But I still struggle to understand the "unit" of that amplitude. I get that amplitude is a measure of the intensity of the sound and that sound is a pressure wave. Is it 20000 what?
--- End quote ---
Ultimately it's 20000 relative to the maximum input amplitude of the ADC that digitised the file.
engineheat:
So the magnitude of those numbers depends on a DAC, and are unit-less. And for the same DAC, a louder sound will result in greater magnitude, but the "sound" itself is defined by the frequency profile. Is this a way to understand it?

I wonder what will happen if I generate a single sine wave of an audible freq like 5khz, convert it to a WAV file and play it on my computer. I will experiment with this but I'd like to know what to expect now. Maybe playing around with a simple sine wave and listening to the effect will make things clear.

thanks
Psi:
When i was doing this i used cooledit to make a WAV file of silence.
Then i zoomed all the way in and edited a few individual samples. Some up to max, some down to max etc..
Then i used a hex editor to see what was happening in the data and look for the patterns.

It really helped to understand the formatting.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod