# Circuit Theory/Decibels

This appendix page is going to take a deeper look at the units of decibels, it will describe some of the properties of decibels, and will demonstrate how to use them in calculations.

## Definition

Decibels are, first and foremost, a power calculation. With that in mind, we will state the definition of a decibel:
    $dB=10\log {\frac {P_{out}}{P_{in}}}$
The letters "dB" are used as the units for the result of this calculation. dB ratios are always in terms of watts, unless otherwise noted.

## Voltage Calculation

now, another formula has been demonstrated that allows a decibel calculation to be made using voltages, instead of power measurements. We will derive that equation here:
First, we will use the power calculation and Ohm's law to produce a common identity:
    $P=VI={\frac {V^{2}}{R}}$
Now, if we plug that result into the definition of a decibel, we can create a complicated equation:
    $dB=10\log {\left[{\frac {\frac {V_{out}^{2}}{R}}{\frac {V_{in}^{2}}{R}}}\right]}$
Now, we can cancel out the resistance values (R) from the top and bottom of the fraction, and rearrange the exponent as such:
    $dB=10\log {\left[\left({\frac {V_{out}}{V_{in}}}\right)^{2}\right]}$
If we remember the properties of logarithms, we will remember that if we have an exponent inside a logarithm, we can move the exponent outside, as a coefficient. This rule gives us our desired result:
    $dB=20\log {\left[{\frac {V_{out}}{V_{in}}}\right]}$

## Inverse Calculation

It is a simple matter of arithmetic to find the inverse of the decibel calculation, so it will not be derived here, but stated simply:
    $P=10^{dB/10}$

## Reference Units

Now, this decibel calculation has proven to be so useful, that occasionally they are applied to other units of measurement, instead of just watts. Specifically, the units "dBm" are used when the power unit being converted was in terms of milliwatts, not just watts. Let's say we have a value of 10dBm, we can go through the inverse calculation:
    $P=10^{10dBm/10}=10mW$
Likewise, let's say we want to apply the decibel calculation to a completely unrelated unit: hertz. If we have 100 Hz, we can apply the decibel calculation:
    $dB=10\log {100Hz}=20dBHz$
If no letters follow the "dB" label, the decibels are referenced to watts.

## Decibel Arithmetic

Decibels are ratios, and are not real numbers. Therefore, specific care should be taken not to use decibel values in equations that call for gains, unless decibels are specifically called for (which they usually aren't). However, since decibels are calculated using logarithms, a few principles of logarithms can be used to make decibels usable in calculations.

### Multiplication

Let's say that we have three values, a b and c, with their respective decibel equivalents denoted by the upper-case letters A B and C. We can show that for the following equation:
That we can change all the quantities to decibels, and convert the multiplication operations to addition:

### Division

Let's say that we have three values, a b and c, with their respective decibel equivalents denoted by the upper-case letters A B and C. We can show that for the following equation:
Then we can show through the principals of logarithms that we can convert all the values to decibels, and we can then convert the division operation to subtraction: