Columnists
Filtering? Before or after?
By Bonnie Baker, Microchip Technology Inc -- EDN, 2/20/2003
Have you ever needed a lowpass or highpass filter in your circuit and wondered where you should place it in the signal path? Before the introduction of controllers and processors, engineers used analog circuits to implement all filters. With this type of design, you needed to think ahead and work up a "pencil design" before going to the breadboard. If you cut corners, you would probably end up disassembling the circuit and rebuilding it, hoping to get it right the next time. Then came the digital filter. This type of filter implementation can duplicate the frequency response of any analog filter in the digital domain. A major advantage of digital filters is that you can painlessly adjust them with firmware. This scenario sounds too good to be true, and it is.
There are times when you should build the filter with analog hardware and times when it is appropriate to implement it with a controller or processor in firmware. Generally, every circuit in which an analog signal converts to the digital domain should have an analog lowpass filter. This situation is true whether the ADC is a successive-approximation-register (SAR), delta-sigma, pipeline, dual-slope, or any other type of converter you may contrive. The placement of this type of filter in the circuit must always be on the analog side, in front of the converter.
Why do you need the analog lowpass filter? Remember that every analog signal has high- and low-frequency noise, whether or not you acknowledge it. The reason you need a lowpass filter goes back to the Nyquist theorem, which illustrates that to accurately convert a signal without contamination, you must first eliminate out-of-band frequencies.
Any signal that passes through the ADC has a magnitude associated with it. The ADC usually faithfully converts the magnitude of that signal as long as the signal frequency is below the converter's input-stage bandwidth. Although the ADC preserves the magnitude, the same is not true for the signal's frequencies. The frequencies above half of the ADC's sampling frequency contaminate the conversion to the point that you won't be able to tell the difference between in-band and out-of-band signals at the converter's output. This phenomenon is known as signal aliasing (Figure 1).
You can see how unwanted noise and signals can permanently embed in the digital signal. Once this contamination occurs, you can't go back and undo it.
Implementing a highpass filter and second lowpass filter is a different matter. You can build these types of filters using analog circuits or firmware. The advantage of building these functions in the controller or processor is that you can implement a variety of easy to adjust filters. This variety includes analog-style filters, such as Butterworth, Bessel, or elliptic. However, you can also implement digital filters, such as an FIR, an IIR, or an FFT. By implementing an FIR filter, you can significantly reduce the in-band noise. You cannot achieve this noise reduction with an analog filter. With an FFT, it is easy to digitally remove unwanted frequencies. You could achieve this removal with an analog circuit, but it would be hardware-intensive.
With digital-filter designs on the horizon, analog filters look fairly unattractive. However, they still have a place in the signal path, as do digital filters. For now, the good news is that digital filters have taken us to the next level of performance, precision, and cost reduction.
| Author Information |
Bonnie Baker is the analog/mixed-signal-applications engineering manager for Microchip Technology's microperipherals division. You can reach her at Bonnie.Baker@microchip.com. |
| Reference |
|















Bonnie Baker is the analog/mixed-signal-applications engineering manager for Microchip Technology's microperipherals division. You can reach her at 


