Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: General dB to % conversion (Read 8115 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

General dB to % conversion

Hi.

A question that's been bothering me for a long time.

How much do i have to decrease the volume in dB to gain a half volume? I've heard it was -6 dB but can i then say that -3 dB is 75% ?

A CD is said to have 96 dB in dynamic range. However, from my programming background i know that it has only 65536 possible values to store. 65536 in the power of ten (means log10) brings out approximately 4.8, that's 48 dB. Where do the other 48 dB come from? (And by that definition, half volume would be -3 dB because log 0.5 = -0.3)

Greetings,

nhash.

General dB to % conversion

Reply #1
20 log 10 not 10 log 10 because the levels on a DAC are amplitude whereas db is in power.

Edit: 

http://en.wikipedia.org/wiki/Decibel#Definition

This section explains how the unit is defined.  Basically, dB is the ratio of power, so if your input is in units of amplitude, you have to square to get power, hence 20 instead of 10.

General dB to % conversion

Reply #2
In "C":
Code: [Select]
/* linear -> deciBell */
/* amplitude normalized to 1.0f. */
float dB(float amplitude)
{
        return 20.0f * log10f(amplitude);
}

/* deciBell -> linear */
float dB2_amp(float db)
{
        return powf(10.0f, db / 20.0f);
}

/* linear -> deciBell */
/* power normalized to 1.0f. */
float pdB(float power)
{
        return 10.0f * log10f(power);
}

/* deciBell -> linear */
float dB2_power(float db)
{
        return powf(10.0f, db / 10.0f);
}

General dB to % conversion

Reply #3
Thank you.

General dB to % conversion

Reply #4
Quote
How much do i have to decrease the volume in dB to gain a half volume?
It depends on what you mean by "half the volume".    Digitally or in terms of voltage, -6dB is half.    Half the power is -3dB.  -10dB sounds like about half the volume to our ears.

The digital amplitude is proportional to the voltage into an analog-to-digital converter or out of a digital-to-analog converter. 

If you double the voltage out of a power amplifier, you also get twice the current (which is proportional to voltage with constant impedance), and therefore, 4 times the power (+6dB).

General dB to % conversion

Reply #5
Does it matter if it's stereo?


General dB to % conversion

Reply #7
Does it matter if it's stereo?
Just treat the left & right channels separately...  If you have 50W from the left speaker & 50W from the right speaker, that's 100W.  Increase both channels by +3dB, and you double the power from each channel for 200W total and an overall increase of +3dB.

However, you can't just add or subtract the decibels...    If you increase one channel by +3dB to 100W and decrease the other channel by -3dB to 25W, you've increased the total power to 125W, from 100W (for an increase of about +1dB, assuming an ideal acoustic space and in-phase signals, etc).

General dB to % conversion

Reply #8
-10dB sounds like about half the volume to our ears.


That's interesting. I have noticed the half volume of many volume meters, like those in winAmp, WMP, Windows system's volume control use -6 dB for a half and that does not quite sound like the half.

However, there are players (VLC, MPC) and even the total volume control of Window's later systems that use an exponential (or is it a logarithmic?) scale, means half selected meter brings out half*half volume, so propably -12 dB.

Both ways seemed imperfect to me. And now you told me why.    Maybe one should program a player that uses a micture of both ways...

/E: Oh well, I've just checked that new player I have installed recently, foobar2000. Perfect. 
/E2: Now i just wonder ... how much percent would -10 db be on a normal scale? (WinAmp, WMP, ...)

General dB to % conversion

Reply #9
-10dB sounds like about half the volume to our ears.


That's interesting. I have noticed the half volume of many volume meters, like those in winAmp, WMP, Windows system's volume control use -6 dB for a half and that does not quite sound like the half.

However, there are players (VLC, MPC) and even the total volume control of Window's later systems that use an exponential (or is it a logarithmic?) scale, means half selected volume brings out half*half volume, so propably -12 dB.


dB is an exponential scale too, and most likely that is what they're using.

The actual underlying APIs in windows allow you to set both linear volume (0 to 1 floating point) which is likely implemented by multiplication (digital scaling) as well as the underlying hardware volume control (analog gain) which is always in dB: 

http://msdn.microsoft.com/en-us/library/wi...v=vs.85%29.aspx (newer windows)
http://msdn.microsoft.com/en-us/library/wi...4(v=vs.85).aspx (older windows)

General dB to % conversion

Reply #10
I don't think I could even begin to figure out what sounds like half to me.

Despite being called logarithmic, volume controls are exponential(ish).

General dB to % conversion

Reply #11
Hi.

A question that's been bothering me for a long time.

How much do i have to decrease the volume in dB to gain a half volume? I've heard it was -6 dB but can i then say that -3 dB is 75% ?


The usual and generally accepted answer is as has been already said, that 10 dB represents a doubling of perceived loudness.

To understand this, consider that while we we dB this and decibel that, the actual whole measure is the bel (named after the inventor of the telephone) and a decibel is a tenth of a bel.

The bel was adopted by the Bell system (AT&T) in 1923 or 1924 based on the fact that it represents 10 times the power.

http://sizes.com/units/decibel.htm

"The decibel began as the transmission unit, defined by researchers at AT&T to replace of the “mile of standard cable.” a unit of power ratio used in telephone engineering."

faculty.spokanefalls.edu/InetShare/AutoWebs/steveg/Decibel%202.doc

"A bel (symbol B) is a unit of measure of ratios, such as power levels and voltage levels. It is mostly used in telecommunication, electronics, and acoustics. Invented by engineers of the Bell Telephone Laboratory, it was originally called the transmission unit or TU, but was renamed in 1923 or 1924 in honor of the laboratory's founder and telecommunications pioneer Alexander Graham Bell.
The bel was too large for everyday use, so the decibel (dB), equal to 0.1 B, became more commonly used. The bel is still used to represent noise power levels in hard drive specifications."

The fact that the bel  approximately corresponds to a perceived doubling of loudness appears to be a coincidence.

General dB to % conversion

Reply #12
/E2: Now i just wonder ... how much percent would -10 db be on a normal scale? (WinAmp, WMP, ...)


I'll try ... -10 dB in power equals -0.5 Bel in volume, right?
now ... Pow (10, -3) or 10^(-3) = 0.3162...

... 31.62 %? Can that be right?

I mean, is not it interesting to know where to set your WMP or WinAmp to get exactly half the loudness?

General dB to % conversion

Reply #13
You got the correct result, but not even the formula that you wrote gives the result you posted.

In my calculator 10^(-3) = 0.001


Wasn't it easier to simply follow one of the four formulas that I posted?

-10dB power to Amplitude  (which is what an audio signal is)  db2Amp -> pow(10.0, db / 20.0)  = 10^-0.5 = 0.316227  = 31.62% as you wrote.

General dB to % conversion

Reply #14
exactly

???

Don't you have this the wrong way around?  Shouldn't you be the judge of what half the loudness is and then see where that puts the volume control on your player du jour?

10^-3 is 0.001, but 10^-.5 is ~32%, which is the number you were trying to find.

General dB to % conversion

Reply #15
Hmm... what was i doing back there with my calculator? :?:

/E: Oh! No i got it.

@[JAZ]: Basically i used your formula, i just wrote a strange '-3' in it don't know why...............

@greynol: Is you trying to say we have different ears and should everyone find out what our unique mid is?

General dB to % conversion

Reply #16
If by "ears" you mean the entire auditory system, including how the brain (re)interprets what it receives from the inner-ear then sure, you bet.  Why not?

If you go back and look you'll notice that no one here said that 10dB was an exact figure.

General dB to % conversion

Reply #17
Let's get back to the players. Why is this knowledge not used for all players? not even the big WinAmp uses a more natural scale, instead all players i knew before downloading foobar use either exponential or say "linear" scales.

Sorry for my bad enlgish.

But i mean, is it really too hard to program a simple mixture of both ways, like this:

50%? 50%²? => 10^((log (50%) + log (50%²)) / 2) (=> 35.4 %)
25%? 25%²? => 10^((log (25%) + log (25%²)) / 2) (=> 12.5 %)

... or are there other reasons that keep them from doing this more natural mixture?

/E: Let me display that a bit better:

Supposed loudness: 100%      75%      50%      25%
Calculated volume: 100%    56.2%  31.6%  17.8%
"Linear" way:          100%    75%      50%      25%
"Exponential" way:  100%    56.3%    25%      6.3%
"mixture way":    100%    65.0%    35.4%  12.5%

General dB to % conversion

Reply #18
Let's get back to the players. Why is this knowledge not used for all players? not even the big WinAmp uses a more natural scale, instead all players i knew before downloading foobar use either exponential or say "linear" scales.


Foobar and most (all?) windows apps use exponential.


Supposed loudness: 100%      75%      50%      25%
Calculated volume: 100%    56.2%  31.6%  17.8%
"Linear" way:          100%    75%      50%      25%
"Exponential" way:  100%    56.3%    25%      6.3%
"mixture way":    100%    65.0%    35.4%  12.5%


Most of those are also exponential, just with different step sizes in dB.

General dB to % conversion

Reply #19
Quote
Most of those are also exponential, just with different step sizes in dB.


How can you call them exponential if they are in truth only half-exponential, for they are the logarithmic half of the logarithmic scale and the straight scale...

Foobar and most (all?) windows apps use exponential.


Maybe we have an understanding issue. Exponential to me is when half the decrease of volume brings back half*half the volume. That means, if you turn the volume down it gets more silence faster than "normally". And if you check you will see that Windows Media Player and WinAmp do not have this "exponential" scale while VLC and MPC have. Check it! If you turn the volume down, Windows Media Player gives louder response at around 20-60% of volume than VLC does. Hence i described them as non-exponential, straight or linear. Don't know which term is absolutely correct.

It is definetly false to say, all windows apps have the same volume pitch behaviour. And foobar2000 seems to have a very special behaviour, responding -10dB at 50% while WMP responds -6dB at 50% and VLC propably -12 dB at 50%.

Again, check. If you then say to me you hear no difference we do not need to continue this conversation for THIS IS HEARABLE clearly.

General dB to % conversion

Reply #20
Sure there are differences, but the "correct" taper of a volume control is really just a matter of personal opinion.

As such I fail to see a legitimate problem here.

General dB to % conversion

Reply #21
How can you call them exponential if they are in truth only half-exponential, for they are the logarithmic half of the logarithmic scale and the straight scale...


Via algebra:

10^((log10(x) + log10(x^2)) / 2) == x^(1.5).

So I shouldn't say exponential, its actually just a little faster than linear volume. 

Maybe we have an understanding issue. Exponential to me is when half the decrease of volume brings back half*half the volume.


So polynomial? 

It is definetly false to say, all windows apps have the same volume pitch behaviour.


Pitch and volume are actually different things.  And I didn't say that all were the same, just that they're all likely to be exponential.

And foobar2000 seems to have a very special behaviour, responding -10dB at 50% while WMP responds -6dB at 50% and VLC propably -12 dB at 50%.

Again, check. If you then say to me you hear no difference we do not need to continue this conversation for THIS IS HEARABLE clearly.


Sounding half as loud means that the volume was reduced by about 10dB.  If the scale really worked the way you were thinking, almost all of the settings would be indistinguishable, and it would suddenly get very quiet at 10% and inaudible thereafter. 

In practice, if you can hear the difference between each volume increment, and theres more than 5 or 6 of them, its using dB.  Since we are even having this conversation, most likely you have never used a device with any other sort of volume control.

General dB to % conversion

Reply #22
Sure there are differences, but the "correct" taper of a volume control is really just a matter of personal opinion.

As such I fail to see a legitimate problem here.


Agreed.

It gets tedious watching people argue over things that are obvious to people who are well-educated enough to argue them logically.  Proper education seems to make a lot of arguments simply go away.  People start talking from the same page. What a concept!

For example, what about the apparent great divide between exponential and logarithmic. One is the inverse of the other. I was taught that they are two sides of the same coin. But here the two sides of the coin seem to exist in two different vacuum chambers and never seem to be connected.

The idea of the so-called logarithmic volume control (which could just as easily be called exponential - depends on how you characterize the control input) is that a given amount of rotation provides the same increase or decrease in loudness no matter where the control is when you start turning.  Seems handy enough, no?  In its way, even even makes some sense! ;-)