I am attempting to do some basic dB calculations using Python. If I use either Excel or a scientific calculator:
20*log(0.1) = -20
in Python:
20*log(0.1) = -46.0517018599
to simplify further, Excel and Scientific calc:
log(0.1) = -1
Python:
log(0.1) = -2.30258509299
I start my script with
import math
log = math.log
Can someone explain why this is and how I can fix it?
from math import logand save yourself a line.log()can mean either base 10 or baseedepending on the programmer.