I'm a beginner in audio signal processing, and trying to calculate the amplitude of a .wav file. I've read some documents from the web and some other questions asked about this topic. However, I still don't know how to calculate the amplitude and sum of the amplitude contour (in dB) from a .wav file in Python. Hope someone can help.
1 Answer
A wave file contains the instantaneous amplitude of the sound signal as series of time domain samples. The most common format is 16-bit signed integer but it can also be floating point, 32-bit integer, etc. I can have one or more channels. For example, stereo will have left and right channels.
librosa.load()
has a lot of options to manipulate the data during the loading process, so I recommend carefully looking at those and pick what's required for your application.
In most (but not all) cases you will end up with a series of floating point numbers that are between -1.0 and +1.0. There is no direct connection too the original amplitude of the sound signal unless you have external calibration information, so you cannot reconstruct the original sound level.
I still don't know how to calculate amplitude and sum of the amplitude contour (in dB) from a wav file in Python.
I have no idea what this is supposed to mean. Please add some more detail or some formulas or equations.
y
contains instantaneous amplitude samples. $\endgroup$