1

I found that some apps can display a decibel (dB) value for audio level. I have been trying for some time but have not been able to find the relationship between power and dB. Can anybody tell me how to do it ?

Paul R
  • 208,748
  • 37
  • 389
  • 560
welsonla
  • 328
  • 3
  • 15
  • possible duplicate of [How to get a volume measurement of iPhone recording in dB, with a limit of at least 120dB](http://stackoverflow.com/questions/2548238/how-to-get-a-volume-measurement-of-iphone-recording-in-db-with-a-limit-of-at-le) – Paul R Oct 21 '11 at 10:38

1 Answers1

4

You can use the formula:

dB = 10 * log10(power);

Note however that dB is a ratio, not an absolute measurement, so your dB values will be somewhat arbitrary unless you calibrate your system. The easiest solution is just to apply an empirically derived dB offset which gives you 0 dB = full scale.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • what's the power stand for.my iphone use [recorder peakPowerForChannel:0],it return the range -160 - 0,this is a the DBFS,but the decibel is the dB SPL – welsonla Oct 21 '11 at 09:40
  • 1
    OK - if you already have dBFS (dB re full scale) then you don't need to do any conversion - you already have a dB (log) scale. To get dB SPL though you'll need to do some calibration, which is non-trivial. – Paul R Oct 21 '11 at 09:47
  • 1
    See http://stackoverflow.com/questions/2548238/how-to-get-a-volume-measurement-of-iphone-recording-in-db-with-a-limit-of-at-le and various other related questions – Paul R Oct 21 '11 at 10:38