Among the classes of logarithmic amplifiers, the DC log amp continues to be a very powerful, cost-effective solution for compressing wide-dynamic-range sensor signals. This article derives the overall DC log amp transfer function from the VBE-to-IC transfer characteristic of bipolar transistors. It discusses the circuit blocks encountered in a modern-day integrated DC log amp, the various errors affecting log amp performance, and a design example featuring the MAX4206. Finally, suggestions for optimizing log amp performance through calibration and design pointers are detailed.
This article was also featured in Maxim's Engineering Journal, vol. 56 (PDF, 324kB).
For over half a century, engineers have used log amps for compressing signals and for computation. Although digital ICs have mostly replaced the log amp in applications that require computing, engineers continue to use log amps to compress signals. Therefore, the log amp remains a key component in many video, fiber, medical, test and measurement, and wireless systems.
As implied by the name, a logarithmic amplifier expresses an output that is related to its input by the mathematical log function (the logarithmic base is not important, as the different log-based functions are related by constants). By utilizing the log function, you can compress the dynamic range of signals encountered by a system. Compressing wide-dynamic-range signals has several important benefits. The combination of a log amp and a low-bit-count ADC can often save board space and system cost, whereas a high-bit-count ADC might otherwise be required. Furthermore, low-bit-count ADCs are often already present in a given system or on a resident microcontroller. The conversion to a logarithmic parameter is also useful in many applications where measured quantities are evaluated in decibels, or where sensors exhibit exponential or near-exponential transfer characteristics.
During the 1990s, the fiber communications industry began using log-amp circuits to measure optical intensity in certain optical applications. Before that time, precision log-amp ICs were both costly and bulky; such expense was warranted in only a handful of electronic systems. The only alternative to these IC solutions were log amps constructed from discrete components. In addition to consuming even more board area, discrete-component log amps were frequently prone to temperature changes and required careful design and board layout. Highly matched components were also necessary to guarantee adequate performance over a wide range of input signals. Semiconductor manufacturers have since developed smaller and less costly integrated log-amp products with reduced temperature sensitivity and added functionality.
Classes of Logarithmic Amplifiers
There are three major classes of logarithmic amplifiers. The first class, the DC log amp, traditionally operates on slowly changing DC signals with bandwidths extending to about 1MHz. Without question, the most popular implementations use the logarithmic I-to-V transfer characteristic inherent in pn junctions. These DC log amps operate on unipolar inputs (current or voltage), and are frequently referred to as diode, transdiode, translinear, and transimpedance log amps. Due to their current inputs, DC log amps are commonly used to monitor wide-dynamic-range, unipolar photodiode currents—either absolute or ratiometric. Photodiode current monitoring is not only a common requirement in fiber communications equipment, but is also found in a wide range of chemical and biological sample-processing instrumentation. Other DC-based log amps exist, such as those based on the logarithmic time-voltage relationship of RC circuits. However, these circuits are typically prone to complications such as widely varying, signal-dependent resolution and conversion times, as well as high-temperature sensitivities.
The second class of log amp is known as the baseband log amp. This circuit class operates on rapidly changing baseband signals in applications where the compression of AC signals is required (common in certain audio and video circuits). The amplifier provides an output proportional to the logarithm of the instantaneous input signal. A special version of the baseband log amp is the "true log amp," which accepts bipolar inputs and provides a compressed output voltage that preserves the polarity of the input. True log amps are sometimes used in radio IF stages and medical ultrasound receiver circuits for dynamic range compression.
Finally, the third class of log amp is the demodulating log amp, or successive detection log amp. This class of log amp both compresses and demodulates RF signals, yielding the logarithm of the rectified signal's envelope. Demodulating log amps are prevalent in RF transceiver applications, where received RF signal strength is measured to control transmitter output power.
The Classic DC Logarithmic Amplifier
In the classic pn-junction-based implementation of the DC log amp, a bipolar transistor is used to generate the logarithmic I-to-V relationship. As shown in Figure 1, bipolar junction transistors (BJTs) are placed in the feedback path of an operational amplifier. Depending on the type of transistor chosen, npn or pnp, the log amp is either a current-sinking or current-sourcing circuit, respectively (Figures 1a and 1b). Through negative feedback, the op amp places enough output voltage on the base-emitter junction of the BJT to ensure that all available input current is drawn through the collector of the device. Note that a floating-diode implementation causes the op-amp output voltage to include input-referred offset; the grounded-base implementation does not possess this problem.
With the addition of an input series resistor, the DC log amp can also function as a voltage-input device. Input voltages are converted to a proportional current though the resistor, using the op amp's virtual ground as the reference. Clearly, op-amp input-referred offset must be minimized so that accurate voltage-to-current conversion can be achieved. The bipolar-transistor approach is prone to temperature variations but, as will be discussed, this sensitivity is drastically reduced by using a reference current and on-chip temperature compensation.
The circuit of Figure 2 shows a BJT log amp with two inputs, IIN and IREF. As described in the previous section, current presented to IIN causes op amp A1 to develop a corresponding output voltage:
k = 1.381 x 10-23 J/°K
T = absolute temperature (°K)
q = 1.602 x 10-19°C
IC = collector current (mA or same units as IIN and IS)
IIN = log-amp input current (mA or same units as IC and IS)
IS = reverse saturation current (mA or same units as IIN and IC)
(In Equation 1, "ln" is used to represent the natural logarithm function. "Log10" is used to express the base-10 logarithm function in subsequent equations).
Although this expression clearly shows the logarithmic dependence of VOUT1 on IIN, the terms IS and kT/q depend on temperature and will introduce a high-degree of variation in the VBE voltage. To remove the temperature dependence caused by IS, a second junction voltage is subtracted from VOUT1 through the differencing circuit, composed of A3 and its surrounding resistors. The second junction voltage is created in the same way as VOUT1, except that IREF serves as the input current. The transistors used to create both junctions must possess nearly identical properties and be in close thermal contact for proper cancellation.
The presence of IREF has two benefits. First, it sets the desired x-axis "log-intercept" current—the current that makes the log-amp output current theoretically equal to zero. Second, it allows the users to take ratiometric measurements, in addition to absolute measurements. Ratiometric measurements are frequently used in optical sensors and systems, where an attenuated light source must be compared to a reference light source.
The expression of Equation 5 is still subject to temperature effects, as VDIFF is proportional to absolute temperature (PTAT). By adding subsequent temperature-compensation circuitry (normally, an additional op-amp amplifier stage with a resistive temperature detector [RTD], or similar device, incorporated as part of the gain), the remaining PTAT error can be virtually eliminated, yielding the ideal log-amp relationship:
where K is the new scaling constant, also known as log-amp gain, given in V/decade. Because applying log10 to the ratio ILOG/IREF determines the number of decades ILOG is above or below IREF, multiplication by K yields the desired units of volts.
Integrated designs are well suited for DC log amps, because key temperature-dependent components can be co-located on the physical circuit, yielding excellent temperature tracking of those components. Furthermore, trimming of various remaining errors is also possible during production. Any remaining errors are generally well documented in the log amp's data sheet.
Modern-Day DC Logarithmic Amplifiers
The functional block diagram of Figure 3 illustrates a typical contemporary DC log amp, the MAX4206. Like previous generations, today's DC log amp possesses op-amp input structures, BJT feedback, a differencing amplifier, and temperature compensation. To eliminate negative driving voltages at its emitter, the BJT transistor's circuit connections have been rearranged to facilitate single-supply operation. An uncommitted op amp is still commonly used for subsequent gain, offset adjustment, or even PID control.
Unlike its ancestors, the contemporary log amp incorporates all its electronics within a small package (the MAX4206 is available in a 4mm x 4mm, 16-pin TQFN package). Prior to 2001, DC log amps were only commercially available in much larger DIP packages with pin counts ranging from 14 to 24. These older components carried a substantial price tag of $20 to $100; today's replacements are readily available in the $5 to $15 range.
Single-supply operation is a new improvement appearing in some modern-day DC log amps, making them desirable for use with single-supply ADCs/systems. The MAX4206 can operate from either a single +2.7V to +11V supply or a dual ±2.7 to ±5.5V supply. A consequence of single-supply operation is that these log amps generally hold a typical 0.5V common-mode voltage at their input terminals in order to maintain proper biasing on the logging BJTs. Because these log amps are current-input devices, this internally generated common-mode voltage is generally not a problem in most current-measurement applications.
The presence of an on-chip current reference has become quite popular in most contemporary DC log amps. This reference can be connected to the reference input of the log amp, thereby permitting an absolute, rather than ratiometric, measurement of the current presented to the log amp's main current input. In the case of the MAX4206, a reference current is obtained by means of a 0.5VDC voltage source, a voltage-to-current converter, and a 10:1 current mirror. An external resistor is required to program the desired reference current.
Also new to DC log amps, an on-chip voltage reference is sometimes provided to assist in adjusting amplifier offset at the uncommitted op amp. This reference can also be used for general purposes.
Without question, the most common applications of the DC logarithmic amplifier are those involving the measurement of light. Two implementations are generally used. In the first, a single photodiode is connected to the logging input, while a reference current is connected to the reference input. The second implementation uses two photodiodes, one connected to the logging input and the other to the reference input. The former implementation is used when absolution measurements of light intensity are desired, the latter for logarithmic-ratiometric ("log-ratio") light-intensity measurements.
Generalized circuits for both implementations are shown in shown in Figure 4. In Figure 4(a), a single photodiode measures the light from a fiber optic channel by viewing the light emanating from a fiber optic tap (1% transmission). A PIN photodiode is depicted in the diagram, although an avalanche photodiode could have been used for greater sensitivity (proper power-supply precautions should be taken if high voltages are used to bias the photodiode). Because photodiodes' output current is generally linear with incident optical power (0.1A/mW is a typical photodiode sensitivity) and the MAX4206 operates over five decades of dynamic range, a circuit like this can reliably measure the fiber's optical intensities from 10µW to 1W. Note that, although the MAX4206 is guaranteed to operate over a -40°C to +85°C temperature range, the effects of changing operating temperature and optical frequency can drastically affect the performance of the photodiode.
For cases where the photodiode's anode is reserved for other circuitry, such as the high-speed transimpedance amplifier (TIA) found in many fiber optic modules, a precision current mirror/monitor may be used at the photodiode's cathode. The MAX4007 series of products are well-suited for this application. Refer to the MAX4206 and MAX4007 data sheets for further details.
When two photodiodes are used in a logging application, the intent is to compare a reference light source against an attenuated light source that is derived from the reference. In this way, the attenuation caused by a given medium can be measured independent of light source intensity (or at least small changes in the intensity). This type of application is commonly found in many optically based gas-sensor applications. In Figure 4(b), a light source's output is split equally into two paths. The first is incident upon the reference PIN photodiode, whose anode feeds the MAX4206's REFIIN input. The other path reflects 90° off a mirror, though the sample, and onto the other PIN photodiode (connected to the LOGIIN input). When calibrated so that the current from the reference photodiode measures 1mA, the current from the other photodiode will measure 1mA or less, depending on the attenuation encountered by the light. By anchoring input currents to 1mA or less, the MAX4206's wide five-decade dynamic range is fully utilized.
It should also be mentioned that, although the MAX4206 is not guaranteed to operate beyond in the 10nA to 1mA input current range, it is often possible to operate the device beyond this range while still maintaining monotonicity between inputs and output.
Sources of Error in DC Log Amps
Today's DC logarithmic amplifiers are still subject to the same limitations seen in previous generations of products. Equation 6 is an ideal approximation of the DC log amp. To obtain the most accurate expression possible, terms resulting from errors in gain, bias currents, offset, and linearity must be considered as well. This is especially important when such inaccuracies are worsened by temperature and time-dependent drift.
A more comprehensive expression representing the BJT-based DC log amp is given by:
where ΔK is the gain variation; IBIAS1 and IBIAS2 are the bias currents associated with the LOGIIN and REFIIN inputs, respectively. VCONF is the log conformity error and VOSOUT is the output-referred offset. K, ILOG, IREF, and VOUT are defined previously. In many applications, errors associated with bias currents are quite small relative to the input and reference currents, and thus are usually omitted from the error expression. Log-conformity error is defined as the maximum deviation from the ideal log relationship of Equation 6 (assuming all other error sources have been nulled). This error is frequently presented in a difference format, so that the small deviations from the ideal plot line can be easily inspected (Figure 5a).
Though not immediately obvious, the reference current, IREF, is potentially a large source of error, composed of initial inaccuracy, temperature drift, and age-related drift. Such errors should be included when assessing the overall error budget of the log amp's operation.
The effects of these nonideal variations are shown in the transfer curves of Figure 5b (these effects have been exaggerated for demonstration purposes). The ideal/desired expression is represented by the black line, shown with a log intercept of 100nA and a gain of 1V/decade. Output offset error shifts the black line up or down, as indicated by the green line. Gain error rotates the offset-shifted transfer characteristic, and is represented by the blue line. The red line shows the effects of incorporating of nonlinearity and output-margin errors.
In practice, the log-amp manufacturers minimize many of the errors presented in this section. With additional calibration and temperature monitoring, designers can reduce the effects of these errors further. The designers usually use calibration tables to perform these corrections after the log-amp output has been digitized.
DC Log-Amp Implementation
The performance of a DC log amp is only as good as the circuit within which it resides. Good design and layout techniques minimize input leakage currents and cross-component temperature variations. However, good design and layout are rarely sufficient to ensure the performance required by most log-amp applications, especially when operated over a range of input currents and temperatures. Depending upon an application's requirements and operating conditions, a suitable calibration procedure should be implemented to minimize cumulative errors.
Here are some tips to consider when implementing a DC log amp.
This is a "bare-minimum" technique that effectively shifts the raw performance line (red line) of Figure 5b vertically, such that it intersects the ideal-performance line (black line) at a single point. At the typical operating temperature, nominal input and reference currents are applied to the respective log-amp inputs. The resulting deviation from the desired result is subtracted from the actual log-amp output during normal operation.
Advantages: Calibration is quick, can be performed during final product testing, and does not require much computation. Calibration can also be performed in the analog domain with a single trimming resistor.
Disadvantages: Gain and offset errors are combined into a single, over-generalized correction. Correction value loses validity as inputs and temperatures are moved from the calibration conditions.
Slightly more complex than the previous technique, this technique yields much better results. It effectively rotates and vertically shifts the "red" line in Figure 5b to approximate the desired "black" line. Again, a typical operating temperature should be selected. Input currents should span the desired operating range. The process is greatly simplified if only one reference current is used in both calibration and operation.
Advantages: Calibration is fairly quick and greatly reduces gain and offset errors. Calibration can be performed in the digital domain by applying gain and offset computations, or in the analog domain with gain and offset trimming resistors.
Disadvantages: Correction values lose validity as inputs and temperatures are changed.
This technique creates a table of calibration data from key sample points. Samples are taken at a single operating temperature. Corrections are performed by interpolating between sampled points.
Advantages: With a sufficient number and strategic selection of input conditions, gain, offset, and nonlinearity errors can be greatly minimized.
Disadvantages: Some form of interpolation is required, which increases the amount of computation involved. Calibration loses validity as inputs and temperatures are changed.
Calibration with Temperature Adjustment
Similar to multipoint calibration, this technique also considers test temperature, creating an extra degree of freedom.
Advantages: This technique greatly reduces gain, offset, nonlinearity, and temperature-imposed variations affecting the total error. Good option for high-performance, low-volume products.
Disadvantages: Calibration times during final product testing are much longer due to spanning of temperatures. Multidimensional interpolation of sampled data significantly increases the required computational resources. An additional temperature monitoring circuit is also required.
Maintaining Proper Input Margin
Log-amp outputs should not operate near the power supply rails, as log-amp outputs have limited sourcing and sinking abilities near these rails. This suggestion is easily overlooked when trying to measure currents near or below the reference current, or near the maximum input current. Choose a reference current that is lower than the lowest expected input current. Gain should be set so that the maximum log-amp output voltage is not attained when the maximum input current is applied. A dual-supply log amp can also help, as identical input and reference currents put the output at midscale in most designs.
Advantages: Accuracy and response time increase under extreme input conditions.
Disadvantages: Usable output range decreases slightly.
Use external resistors that are the same type and possess low-temperature coefficients. This is especially important for resistors whose absolute value influences performance (e.g., a reference current generator circuit). Parameters affected by resistance ratios, like gain and offset, are generally less affected by temperature changes. The temperature stability of compensation components is generally not critical. To avoid leakage issues when measuring small currents, low-leakage PC material should also be considered.
Advantages: Minimizes additional performance degradation created by external components.
Disadvantages: Low-temperature-coefficient components are generally slightly more expensive but are well worth the cost, given the increased performance they can provide.
Uniform Temperature Exposure
No part of the log-amp circuit should be exposed to a temperature that is significantly different from any other part of the circuit. This precaution ensures that all circuit changes caused by temperature will track each other more closely.
Advantages: Further degrees of freedom are eliminated in the calibration process.
Disadvantages: This may cause inconvenience in layout routing or overall circuit size.
In summary, DC log amp ICs have evolved into small, easy-to-use, cost-effective circuits nicely suited for certain analog designs. The logarithmic function conveniently compresses wide dynamic range signals and linearizes sensors with (semi-)exponential transfer functions. The compression created by the log function reduces the ADC bit count that would be required to digitize a wide-dynamic-range signal. Circuit implementations of DC log amp ICs are straightforward, and can be optimized with minimal effort. Calibration procedures can enhance log-amp performance, but are not necessary in all applications.