Re: [LAD] Gain in dB

From: John Rigg <ladev6@email-addr-hidden>
Date: Wed Oct 16 2013 - 11:51:21 EEST

On Tue, Oct 15, 2013 at 04:41:46PM -0400, Fred Gleason wrote:
> On Oct 15, 2013, at 10:11 05, André Garnier Coutinho wrote:
>
> > GdB = 20log(Out/In) ?
>
> Close. You actually want:
>
> GdB = 20*log10(out/in)
>
> You probably knew this already as standard mathematical notation assumes log == 'log to the base of 10'. However, the log() function in the math library will get you natural logarithms ('log to the base of e'). You want log10(). Been there, done that confusion myself… :)

Good catch. I was thinking of the non-C convention of using log for base 10 and ln for natural log when I answered.

John
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Thu Oct 17 00:15:01 2013

This archive was generated by hypermail 2.1.8 : Thu Oct 17 2013 - 00:15:03 EEST