Hi
I want to know the relationship between a dB and an actual sample in the computer!
So for example if Ive a 16-bit sample and I want to change the volume by XdB what does the formula look like?
Thanks!
Problems every where
Decibel, dB, is a logarithmic unit.
The formula is something like
20*log(A1/A2), or 20*log(gain)
(log base 10), where A1 and A2 are two amplitude (and gain the ratio between).
If you want to add X dB gain to a sound signal, just to this :
X = 20 * log(gain)
gain = exp(X/20)
then you just multiply all your samples by gain.
For example 6dB is about a gain of 2.
The formula is something like
20*log(A1/A2), or 20*log(gain)
(log base 10), where A1 and A2 are two amplitude (and gain the ratio between).
If you want to add X dB gain to a sound signal, just to this :
X = 20 * log(gain)
gain = exp(X/20)
then you just multiply all your samples by gain.
For example 6dB is about a gain of 2.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement