Advertisement

dB

Started by February 27, 2008 02:26 AM
2 comments, last by Pilo 16 years, 9 months ago
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.
Advertisement
Thank you very much!
I got it to work;D
Problems every where
Great ;)

This topic is closed to new replies.

Advertisement