• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HAL user-land audio driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HAL user-land audio driver


  • Subject: Re: HAL user-land audio driver
  • From: "Mikael Hakman" <email@hidden>
  • Date: Wed, 2 Apr 2008 23:16:36 +0200
  • Organization: Datakonsulten AB

On April 02, 2008 5:23 PM, Kevin Dixon wrote:
On On Apr 2, 2008, at 4:13 AM, Mikael Hakman wrote:
You mentioned before that there are routines in Core Audio that can
provide
various mappings from scalar value to dB. What are their names? I would
need
a mapping that better corresponds to human perception of loudness than
linear dB mapping does. My own experience tells me that the steps at low
volume should be larger and the steps at high volume should be smaller.

I've heard tell of these functions as well, but its pretty trivial to compute these for yourself

for instance, dB to linear:

linearGain = 10^(dbGain / 20)

0 = ~-120 dB, 1 = 0 dB, and also works for increase in gain

Then solving for dbGain, you get

dbGain = 20 * log10(linearGain)

The question was about a mapping that for linear steps in 0 - 1 range will produce dB values in a dB range, such that the resulting loudness steps will be perceived by a human listener as equal.


The formula you wrote is simply a definition of dB scale. As such it is correct but it has nothing to do with loudness as perceived by humans. If I understand you right, for equidistant linear steps, your formula will produce equidistant dB steps. At low and at high volume levels this will not be perceived as equidistant loudness steps. Going from low to high, the loudness increase will be perceived as too small at the lower end, and as too large at the high end. While linear dB values are certainly better in this respect than the linear attenuation, voltage, power, or intensity values (which is the reason for dB scale invention) they are not precise enough over wide loudness range.

Even without dB definition, and without log and power functions, you can generate such values, if this is what you want:

dbValue = dbMin + linValue / dbRange;        0 <= linValue <= 1

I need more precise formula. Increasing by 6 dB from 60 dB to 66 dB doesn't fill as the same increase as from 80 dB to 86 dB.

Please refer also to Jeff's answer to this question. The X^2 curve he mentions seems better suited for the purpose.

/Mikael

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: HAL user-land audio driver (From: "Mikael Hakman" <email@hidden>)
 >Re: HAL user-land audio driver (From: "Kevin Dixon" <email@hidden>)

  • Prev by Date: Re: Getting an AudioStreamBasicDescription from a stream, not a file
  • Next by Date: Re: Getting an AudioStreamBasicDescription from a stream, not a file
  • Previous by thread: Re: HAL user-land audio driver
  • Next by thread: Re: HAL user-land audio driver
  • Index(es):
    • Date
    • Thread