Hacker News new | ask | show | jobs
by exmadscientist 8 hours ago
Or, to say a little more explicitly what you're getting at: when you take a logarithm of some quantity, log x, x absolutely must be unitless. There's no way whatsoever to take a logarithm of something with a unit attached. (This is an important and useful dimensional analysis check in formulas and long calculations!)

So what do you do in practice? You have to normalize: you don't calculate log x, but instead log x/U for some scaling unit U. It's typical for U to be something like 1 mV or 1 W in electrical engineering, for example. This is completely legitimate, but it does mean that the thing that comes out needs a corresponding unit attached to it: dBmV, dBW, et cetera.

And it's really kind of important to be careful about that.