Why use db for unit of audio volume?

0 favourites
From the Asset Store
10 different explosions rendered as transparent PNG.
  • I have a small question, why use db for unit of audio volume? instead of a linear number.

  • Agree'd

    It's very hard making sound controls when you're dealing with db.

    (hard as in; I don't know how)

  • It's not too hard to make a function to convert back and forth from db and a scale system (e.g. 0-100).

    Scale = 100 * 10 ^ (dB / 33.2)

    dB = -log10(100 / Scale) * 33.2

  • It's not too hard to make a function to convert back and forth from db and a scale system (e.g. 0-100).

    Scale = 100 * 10 ^ (dB / 33.2)

    dB = -log10(100 / Scale) * 33.2

    "Not too hard"

    But hey, it works!

  • I have a small question, why use db for unit of audio volume? instead of a linear number.

    It makes sense for some applications when dealing with signals that can take values over very large ranges, but for applications intended for PC or phone speakers I agree, it's not very useful.

  • 7Soul well it's not too hard once you know the formulas. I copied them off someone else in another thread

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 7Soul well it's not too hard once you know the formulas. I copied them off someone else in another thread

    I might add:

    dB = -log10(100 / Scale) * 33.2 = log10(Scale/100)*33.2 I prefer the second one since you see directly that scale and dB have their increase and decrease related

    also You forgot one thing.. 0, you have to take care of the 0%, since I think it is possible that C2 does a math error (log(0) does not exist)

    EDIT: from where does that 33.2 comes from, I've always wondered?

  • I had checked the audio plugin, it used linear number inside. So it might have some reasons that Ashley decided to use db instead of linear number at the interface of audio plugin.

  • because DB are tought in audio engineering school. Often because of the non linear interpolation and the common measurement use world wide.

    this is much akin to why did ashley set the colouring system using 1-100 and not the 1-255 that's common around the internet. Ashley sure got a lot of flak for that decision. At least DB is the common system used by all tools.

  • jayderyu

    Not really all tools, the audio plugin will transfer db to linear number for internal function call.

    And the players did not know the db, they might want to set the volume to 0.5 (linear number) directly.

    So designer need to transfer the linear number to db at event sheet, then the audio plugin transfer db to linear number back.

  • dB is a much more sensible unit of audio volume than linear scale, because audio volume is perceived with a logarithmic scale. Halving the linear volume of audio results in a drop of 6 dB, and will be perceived as just slightly quieter, not half as loud. "Half as loud" usually corresponds to about -10 dB attenuation. So if you want all your SFX at -5 dB so the music is louder, then you want another sound effect to be "half as loud", you go for -15 dB. To keep dropping the perceived volume by the same amount you'd keep going to -25 dB, -35 dB, etc. Using a linear scale you play all your SFX at about 0.562, then if you want half as loud as that, you drop it down to 0.178. Then stepping down by the same perceived amount you'd go 0.056, 0.018... Not particularly intuitive!

  • Ashley

    Thanks for this illustration, so if I want to linear fade-out, it would be better using linear interpolation with db unit?

  • Yes, absolutely. That's probably a better example: if you lerp a linear volume from 1 to 0, it will start off hardly getting quieter at all, then will appear to abruptly go silent. (In my previous example see how the last three levels are all under 0.2.) On the other hand if you lerp the dB from say 0 to -60 dB, you will get a smooth fade-out.

  • Here's a couple of formulas for converting between dB and Amplitude (0-1 scale):

    Amp to dB: pow(10, dB Level/20)

    DB to Amp: 20 * log10(Amp Level)

    As mentioned, amplitude is not linear. (1 = 0dBFS, 0.5 = -6dBFS, 0.25 = -12dBFS, 0.125 = -18dBFS, etc..)

    I've been an audio engineer for the past 8 years and a VST developer for about 4 years so this comes in handy for me. If anyone wants to play around with the values rather than plot them on a graph or whatever, here's a nice converter that helped me out when I was learning: http://www.plugindeveloper.com/05/decib ... tor-online

    <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • rexrainbow

    I'm only going by my experience with one audio engineer. Whom had taken his classes from Vancouver Film school and was using Sound Forge. I my self only use Audacity as it is free. However I talked with our engineering about why db are used; the reasoning went over my head. We did however include the talk why not simpler means. The only aspect I understood is that the frequency translational levels when effected by Gain or other effects are usually not linear. Sound is a frequency and pitch and the linear scope doesn't apparently work well in audio engineering.

    Again I am not the expert however if the rest of professional industry are being tought DB then it behooves us not to break the convention for the purpose of communication.

    I'm not arguing that there isn't a mathematical model to use linear change in Gain, but I suspect that reducing a frequency by 50% isn't 50% of Normalized.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)