(no title)
49pctber | 9 months ago
"Plain" decibels are simply (power) ratios. These can describe multiplicative changes in power. These are positive for gains (like in a power amplifier) or negative for attenuations (like path loss). They are unitless quantities.
Decibels add. A ten 10 dB gain (x10) followed by a 20 dB loss (x0.01) is -10 dB (x0.1).
"Flavored" decibels are in reference to some power quantity. For example, dBm uses one milliwatt as its reference. So 2 mW / 1 mW = 2 = 10^(3/10) = 3 dBm. These quantities have associated units, but they're still technically dimensionless.
Here's the key insight. You can only have one "flavored" decibel value per computation. Say you have some 3 dBm signal (2 mW). You can add as many regular decibel values as you want, but the unit is still dBm. 3dBm + 4 dB - 7 dB = 0 dBm. In linear units, 2 mW * 2.5 * 0.2 = 1 mW
If you were to do something like 3 dBm + 0 dBm, the linear units would be 2 mW * 1 mW = 2 mW^2, which is probably not what you want.
dBs are confusing. Different fields have slightly different conventions. People talk about any factor of 2 as a 3 dB change, when technically it should only be relative to power-like quantities. It's weird that some of these "units" can be added together, while others can't. The factors of 10 and 20 can be confusing.
But if you consider the units from a dimensional analysis standpoint, decibels are much more sane and intuitive than they appear.
timerol|9 months ago
It's worth noting that this is wrong, in exactly the way that makes decibels confusing. 3 dBm is an absolute power figure (about 2 mW). 2 mW / 1 mW is a ratio of 2 (about 3 dB).
2 mW / 1 mW = 2 = 10^(3/10) = 3 dB.
2 mW = 2 * 1 mW = 10^(3/10) * 1 mW = 3 dB (1 mW) = 3 dBm.
tbihl|9 months ago
I have to teach non-engineers C programming for an undergrad course, which is basically trying to teach very explicit attention to punctuation (among many other things). "Watch those double quotes!", "single quotes, not double!", "where's your semi-colon??", and so on.
Then, three weeks into the course, we're passing values by reference with &, and I get the question, "isn't that scanf missing the and-sign in front of the string name?", and I'm forced to answer, "that punctuation doesn't matter, this time," because the C standard makes & do nothing in front of a string specifically because so many people were confused about that fact that a string's variable name is already passing by reference.
49pctber|9 months ago
nayuki|9 months ago
I think this is analogous to https://en.wikipedia.org/wiki/Affine_space . If I understand correctly, an affine space has absolute points and relative vectors.
In terms of types: point ± vector = point; point + point = illegal; point - point = vector; vector ± vector = vector.
Similar with datetimes - you have absolute datetimes (e.g. 2025-05-23T05:16:35Z) and relative offsets (+1 minute, -1 day, etc.). You cannot add two datetimes together.
A plain decibel would be a vector, and a flavored decibel would be a point.