db volume scaling

Tim Blechmann tim at klingt.org
Thu Jun 11 08:29:34 UTC 2009


>>>>> If they implement the scaling patch (so Tim gets the dB scaling he
>>>>> wants) but leaves the UI with % marks for a normal user, everyone will
>>>>> be just fine, since those who understand logarithmic scales will be
>>>>> able to do the math for a %-dB conversion on the scale Tim has
>>>>> suggested.  Especially since Tim has already outlined how he did it.
>>>> well, several people argued _not_ to change the mapping:
>>>> http://article.gmane.org/gmane.comp.kde.amarok.devel/14535
>>>> http://article.gmane.org/gmane.comp.kde.amarok.devel/14556
>>> Actually, I did not argue not to change the mapping.
>>>
>>> I should clarify that when I said I don't like logarithmic sliders, I
>>> meant ones that show dB values, not ones that behave logarithmically.
>> then, why didn't you write that before?
> 
> Why wasn't I clear before?  Because I didn't realize I wasn't being clear.

just for the record, some people are happy with the current mapping:
http://article.gmane.org/gmane.comp.kde.amarok.devel/14583


>>> I
>>> understand the point of them on hifi amplifiers where a particular
>>> loudness value can be guaranteed, but not on computers where multiple
>>> sliders (not just in Amarok, but various ALSA mixer values, for
>>> instance) can be affecting the volume.  I don't see how you can always
>>> guarantee an absolute value on a normal box with a random built-in sound
>>> card -- this is why I've been saying that the decibel values you would
>>> show would be relative, not absolute.
>> well, the _definition_ of decibel is, that it is relative, not absolute.
> 
> Which is my point.  So then how loud is 0dB, if you see it in Amarok? 
> -60dB?

in the digital domain, audio signals are usually represented as floating
point numbers in the range from -1 to 1. if you change the volume, you
multiply the signal sample-wise with a scalar.

so, now, what does 0dB mean? according to [1] decibel is defined as:

  d = 20*log10(a/a0)

where a is the amplitude, and a0 the reference amplitude.

in the digital domain, the reference amplitude of the full dynamic range
is used (i.e. 1.f), which greatly simplifies the formula to:

  d = 20*log10(a)

inverting this function gives me:

  a = pow(10., d / 20)

0dB means that the signal vector is multiplied by 1, at -20dB, it is
multiplied by 0.1, at -40dB it is multiplied with 0.01, at -60dB by 0.001.

now, if you have an amplifier, which produces a sound pressure level of
80 db(SPL), if you have a volume setting of -10 dB, you hear 70 db(SPL),
if you reduce it to -30dB, you hear 50 db(SPL) ...

>> you are proposing to use relative/linear units for a logarithmic
>> mapping, while you can use relative/logarithmic units for it ... now,
>> what is more confusing for a user?
> 
> Logarithmic.  I think the benefit of remapping would be that users have the
> ease of the percent scale while having the actual relative loudness, as
> perceived by the human ear, seem to track linearly.

having a logarithmic scale, mapped to percent, what is the meaning of 0%
or of 20% in terms of amplitude? you would need to define the lower
threshold (since as you probably know, log(0) is -inf). using dB units,
the lower threshold is transparent, with percent units it isn't ...

mapping a percent unit to a logarithmic scale, you need two reference
points, a lower and an upper threshold, where the upper threshold is an
amplitude of 1.
using decibel units, you just need one reference point.

therefore decibel are a fully defined logarithmically scaled units,
while percent are not. if i see the decibel value, i know the maximum
signal amplitude, while someone, having no idea, what db are, can
calculate the amplitude after consulting wikipedia.
with a percent units, someone would have to read the amarok sources to
be able to calculate the amplitude. so you want the people to read
wikipedia or the amarok sources?

best, tim

[1] http://crca.ucsd.edu/~msp/techniques/latest/book-html/node9.html

-- 
tim at klingt.org
http://tim.klingt.org

Desperation is the raw material of drastic change. Only those who can
leave behind everything they have ever believed in can hope to escape.
  William S. Burroughs

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/amarok/attachments/20090611/dd6284e9/attachment.sig>


More information about the Amarok mailing list