Convert a magnitude to decibels (dB)
If A is magnitude,
db = 20 * log10(A)
mag : float or ndarray
input magnitude or array of magnitudes
db : float or ndarray
corresponding values in decibels