5

I'm trying to get the decibel of noise being recored from mic on Android phone. I can get amplitude value and looking for the formula to convert it into decibel.

I use following function of MediaRecorder to get amplitude.

mediaRecorder.getMaxAmplitude() ;

In another question I found the following formula.

power_db = 20 * log10(amp / amp_ref);

amp is amplitude but not sure what's amp_ref.

Is there anyone knows the correct formula?

Community
  • 1
  • 1
Sharjeel
  • 15,588
  • 14
  • 58
  • 89

1 Answers1

2

i think that is the correct formula. amp_ref is reference amplitude

Kevin Qiu
  • 1,616
  • 1
  • 13
  • 15
  • its something you define yourself. you just need a value to compare to (like a base value). read this, might be clearer: https://ccrma.stanford.edu/~jos/st/DB_Display.html – Kevin Qiu Sep 23 '11 at 05:17