lavster said:
how do you know when to use dB= 20log(ratio of input/output quantities) or dB=10log(ratio of output and
inout).
Brief answer: decibel is
ALWAYS "10x".
Here is why (aka very long answer): decibel is one of those unfortunate units that they tell you about at the university but spend maybe
only a few minutes explaning what it really means.
The unit is actually called 'Bel' (named after Alexander Graham Bell, the man who is generally recognized as the one who invented a
telephone). It's not technically a unit (as say 1 meter) but rather a ratio of 2 numbers (actually "the order of ratio of 2 numbers"). It
shows the
order by which the 2 numbers differ. So 100 000 and 10 differ by 4 order or 4B (4 Bel) (because log (100 000/10) = 4 ).
The "log" calculates (from definition) the order of ratio of those 2 numbers.
Now, say you want to use "bels" in electronics. You have a weak input signal somewhere around 1uV (or 1uW) or any other "micro" level you
can think of, and after processing you have - say - levels somewhere around 10V or 10W or 10 whatever_units. That's a difference of 7
orders or 7 Bel. That gives you a range of values between 0 and 7 (if you pronounced the input level as 0 bel) or generally n .. n+7 bel.
It's a very short range so if you compared 2 values within the circuit you would need to use many decimal points to provide a result that
is exact enough. Say you'd need to say, that the ratio is 3.58bel. It's a number that's supposedly more difficult to remember than for
instance 42 or 42.3. That's where the 'deci' comes in.
"Deci" is a
standard (metric) prefix meaning "(one) tenth" much the same way as kilo is a
prefix meaning thousand (i.e. 1000) and micro meaning "one milionth" (10^-6). So 1 decibel is "one tenth of a bel". To get decibels from
bels you just multiply bels by 10 (again, exactly the same way as you get hertz (Hz) from kilohertz (kHz) by multiplying by 1000 and volts
from microvolts by multiplying by 10^-6).
Now, back to our measurement of 3.58B. If we multiply it by 10 we get 35.8 decibels (35.8dB) which is supposedly easier to remember that
3.58B.
Using "tenths of a unit" instead of the full unit expands our range of 7 units or orders (or 7 bel) for a typical electronics circuit to 70
new units (or tenths of the original unit or 70dB). That gives us wider range of many different numbers (easier to remember) and less
numbers behind a decimal point for a given precision.
lavster said:
voltage seems to be 20, power seems to be 10...
The question is, if dB is always 10x B (bels) where does the "20"come from? Well, it appears when you calculate power transfer (let's call
it "T") and derive the values of input and output powers from measurements of voltage at both ends of the circuit. P=U x I=U x (U/R) = U^2
/ R
T=10 log (P_out/P_in)=10 log ( (U_out^2/R) / (U_in^2/R) ) = 10 log (U_out^2 / U_in^2) = 10 log ( U_out/U_in )^2 = 10 x 2 x log (U_out/U_in)
= 20 log (U_out/U_in)
lavster said:
how about when doing Fourier transforms and you want to find out 3dB of maximum, for example?
It's always 10x (because of the "deci-" prefix), even when it appears as (20x) (actually 2x10x) as demonstrated above (the "2" comes from
the squared argument "behind" the logarithm, so moving it in front of the logarithm saves us computing the squares, although nothing
prevents you from calculating the squares or the square of the ratio and then just multiplying the resulting logarithm by 10).
Hopefully, I explained it to you well enough. I wish somebody explained it to me like this years ago when I had the same question(s).
Eventually someone did (actually touched on the explanation and I was able to derive the rest), I passed many exams, thought I had a good
understanding of why using logarithms and bels/decibels makes sense but even now, years later I still find from time to time some usage,
benefits and properties that I wasn't aware of or had a poor understanding of.
Wikipedia has another explanation of
decibel.
Good luck.