Jump to content
  • Advertisement
Sign in to follow this  
Jiia

Decibels

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

20 decibels is 10 times more than 10 decibels (10 = 10) 30 decibels is 100 times more than 10 decibels (10*10 = 100) 50 decibels is 10000 times more than 10 decibels (10*10*10*10 = 10000) Are these correct? Actually, I'm not sure if 50db is 10,000 times more than 10db or 100,000 times more. But 10,000 was the only one I could match math with, ha! Anyway, I'm going way off track. I guess the basic idea is that each 10db means 10x more. But how does this translate to single decibels? Or even hundreds of a decibel? My goal is actually to convert from percentages to decibels. I know that decibels are infinite, and so percentages are not possible. But I know the maximum decibel level of the value I'm computing. Does this change the situation? For sake of an example, let's just say that a certain stereo has a volume range of -30db (off), and up to 0db (full blast). Is there a way to calculate the volume's DB by knowing the percentage of the volume slider? I'm lost and appreciate any kind of insight [smile]

Share this post


Link to post
Share on other sites
Advertisement
Too insightful for me

edit..

Errr, wait a sec. Does this mean 11db is 2x more than 10db? 12db is 3x more than 10db? So 2db is 2x more than 1db, yet 3db is 2x more than 2db. This means each digit is raising by a power of 2, duh. Damn dude, you the man.

eh. no. That doesn't match up. If so 30 would be 20 times more than 10. Ack.

[Edited by - Jiia on March 27, 2005 2:05:34 AM]

Share this post


Link to post
Share on other sites
I really appeciate the link, but I've already scrounged more than I can stomach. Most of these sites are dealing with decibels in real life, rather than in a computerized scale.

I'm trying to convert a percentage of volume into a DirectSound decibel level. Strange how there are absolutely no threads to find about this. It's either very easy or no one even realizes the difference. Or perhaps everyone that uses DirectSound uses no other sound API, and works purely in decibels.

The most ironic thing about this is that DirectSound or the sound card is probably converting back to a percentage.

I'll try again later, my head hurts [sad]

Share this post


Link to post
Share on other sites
I spent the last half hour doing math. [sad]

10 = 10
20 = 100
30 = 1000
40 = 10000
50 = 100000

10^(x/10)

if 10

m >= d >= n

l(x) = 10^(x/10)
c(x) = l(x)/c-z

1 >= p >= 0
c(m) >= p >= c(n)
l(n) = z
l(m)/c = 1+z

10^(n/10) = zc
10^(m/10) = c+zc

10^(-30/10) = zc
10^(0/10) = c+zc

0.001 = zc
1 = c+zc

0.001 = zc
1-c = zc

0.999 = c
0.001001 = z

d = c-1(p)
c(x) = l(x)/c-z

yc+zc = 10^(x/10)

log(8)/log(2)=c
2^c = 8

10^(x/10) = yc+zc
c-1(y) = 10log(yc+zc)

d = c-1(p)

d = 10log(p0.999+0.0001)

0% = -40
50% = 16.985363620195530146228016728609
100% = 19.??????????????????????????????

lol p = 50? should have been p = 0.5 mes stupid

0% = -40
50% = -3.0137757029790209753045731952852
100% = -0.0039104102858294304456699375418313



Its not perfect but it looks like it will work ok.

(Note: If theres anything strange in my math just ignore it please. Its very late.)

edit: Maybe tomarrow I will make it work better. No promises tho.
And if you dont want to look through it all
decibels = 10*log10(percentage*0.999+0.0001)

Share this post


Link to post
Share on other sites
Quote:
Original post by Jiia
I'm trying to convert a percentage of volume into a DirectSound decibel level. Strange how there are absolutely no threads to find about this. It's either very easy or no one even realizes the difference. Or perhaps everyone that uses DirectSound uses no other sound API, and works purely in decibels.


Decibels are measured from some reference point. I mean that, often 0dB means the volume which is the lowest volume you just and just can hear (or actually you can't). This volume level is personal.

In some pre-amplifiers the 0dB level is the maximum volume and something like -90dB will be the minimun volume level. That is, they use the level of damping.

Now if you really really wan't to represent 0% volume (meaning no sound at all) you would need to use -infinity dB, regardless of what is your reference. But in practive 16bit quantization of audio gives you aprox 90dB of dynamics so -90dB "volume level" probably equals to 0% (assuming 0db <-> 100%).

But you really have to know the reference DirectSound is using. And what scale it is using. Do you really need the 0%, which would require representation of -infinity? If not then some form of adjustment to the normal decibel equations is needed so that -90dB would equal to 0% and 0db to 100% (depending what's your reference).

Share this post


Link to post
Share on other sites
Damn, Mike. That's crazy! I really appreciate you going through hell to accomplish it. I also wish I had a clue how to follow it. I did test it, and it seems like it's outputing the correct db ranges, but I'm not sure how to be certain. So you're computing the db level without even knowing the range of Dbs represented in DirectSound? Hmm, I've heard some people say that's impossible. It's going to take me days to comprehend your 30 minute work. Guess I should get started.

Winograd:

Yes, DirectSound uses damping. Db is specified in hundredths of a decibel ranging from -10000 to 0, where -10000 is silence. But -3000 is about where the sound can no longer be heard. So MS uses -100db to 0db. But reversing the order should be simple, right? I mean surely decibels count up the same way they count down?

I need to look into this log10 thing, it's new to me. I've seen it a bunch on decibel sites, but didn't realize it was a standard math function. My bad :(

Share this post


Link to post
Share on other sites
Most volume sliders work on a logarithmic scale anyway, since that's how humans perceive loudness. So 50% volume is not 50% as much power transfer as 100% volume on a normal volume control. It's much less.

Share this post


Link to post
Share on other sites
just as a short reference for log:

it basically tells your what power of the logrithum a given number is for example log10 of 100 = 2 because 2 ^ 10 = 100
also log2 of 16 = 4 because 2 ^ 4 = 16

hope i helped =)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!