In a *linear* amplifier, the input V and output V' voltages are related by V' = GV + B, where G is the *gain*. In a *logarithmic* amplifier, they are related by V' = A log V + B. It is not as hard to make a logarithmic amplifier as it might seem, because we have a very accurate exponential relationship between the collector current I and base-to-emitter voltage V_{BE}: I = I_{o} exp(qV_{be}/kT), or V_{be} = (kT/q) ln (I/I_{o}). Logarithms to different bases are proportional, so we can easily change bases if it is convenient. In particular, log x = 0.4343 ln x, or ln x = 2.3026 log x.

The difference in the base-emitter voltages of two transistors is V_{be1} - V_{be2} = (kT/q) [ln (I_{1}/I_{2}) + ln (I_{o2}/I_{o1})]. If we can hold I_{2} constant, then the difference is proportional to ln I. We can easily make a current proportional to a voltage, so our problem is solved.

A circuit that does just that is shown in the diagram at the right, simplified down to the essentials. We use two op-amps, each with a virtual ground at the inverting input, where we create the currents I_{1} and I_{2}, one from the input voltage and one from a reference voltage, here +12. The reference current is 10 μA. A 412 is a good choice for the op-amp, since it is a dual, and the bias currents are very small, so they do not have to be considered. The op-amps maintain the collector currents at the desired values. The 330 pF and 47 pF capacitors only have the function of ensuring stability at high frequencies. The two transistors are 2N4124's--I just happened to have them handy. If you were making a serious logarithmic amplifier, you might want to use a specially-matched pair of transistors like the LM394. However, the 2N4124's will work just fine, and we can see what a little mismatch would cause.

The key to the circuit is node "a" where the voltage is V_{be2} - V_{be1}. The output voltage is simply a multiple of this voltage, here 16 times, but in general (R_{1} + R_{2}/R_{2}. The ratio of the collector currents is (V_{in}R_{3})/(V_{r}R_{4}), or 10V_{in}, with the values shown. If we substitute all these numbers in the formula, using 0.025 V for the thermal voltage, we find V_{out} = -0.4 ln V_{in} - 0.921 + 0.4 ln (I_{o1}/I_{o2}). Note how the factor 10 and the difference in I_{o}'s affect the expression. By properly choosing values, and using matched transistors, we can get rid of the constant term. It's not worth the bother here, and we learn a little more anyway.

Now build the circuit and test it, using a buffered potentiometer for the input voltage, as usual. Plot the output voltage as a function of the natural logarithm of the input voltage. I got a very nice straight line from only seven points, and the formula V_{out} = -0.44 ln V_{in} - 0.90 (hardly accurate to two places), which agrees nicely with the expected equation. The thermal voltage is a little higher than 0.025 V anyway, since this is August. The input current varied from 1 mA down to 0.5 μA in the test.

With a logarithmic amplifier, you can create a meter that reads directly in dB, or handle signals with a large dynamic range. It is interesting that this circuit works so well, in any case. The circuit can be dressed up with zero adjustments and other niceties.

Return to Electronics Index

Composed by J. B. Calvert

Created 13 August 2001

Last revised