Mechanical filters are easy to find close by—in a heating and air conditioning system, in a water dispenser, and under the hood of a car. Replacing an air filter after a few months shows how many impurities float around unnoticed until trapped. That prompts a question: do electronic signals get dirty? Noise comes with analog circuitry and is a big reason for moving signal processing into digital.
There’s more electronic dirt out there, though. If it gets through the input of an analog-to-digital (A/D) converter, the digital data can be messy. For many maker projects, cleaning up A/D conversion with filtering is an effective step that helps results.
Three categories of noise
I can hear purists right now saying anything unwanted around a signal of interest is, by definition, noise. Different categories of electronic dirt produce different effects and need different methods for dealing with them. These effects may be tougher to visualize in time domain but become obvious in frequency domain. Sampling a signal with an A/D converter puts the frequency domain into play, thanks to the work of Nyquist and Shannon.
The first category is white noise. In the visible color spectrum, white is the combination of all colors. In an electronic spectrum, white refers to noise showing up across a band of frequencies. Perfect white noise implies the familiar bell-shaped Gaussian distribution. For this discussion, I’ll accept well-distributed noise from low frequencies up to and perhaps beyond the sample rate of an A/D converter.
The second category is spurious signals. There can be a signal coming from somewhere at a particular frequency, but not correlated with the signal of interest. Like many of you, I have speakers connected to my PC via USB, with a subwoofer. Not long after buying them, an annoying hum developed in the subwoofer. It seemed constant when AC power was on but sounded higher than 60 Hz. Long story short, the screws holding the amplifier to the subwoofer case were loose. A bit of thump caused a rattle, which fed back into a resonant tone. Tighten the screws, solved. Other examples are spurious signals due to electromagnetic interference (EMI), resonances between components, and parasitic capacitance and inductance sources.
The final category is harmonics. For a slow sensor—say, grabbing a temperature reading once per second, or a pressure reading 10 times a second—harmonics generally don’t have much impact. Things start happening as frequencies increase on the signal of interest, say in audio applications. A perfect analog signal would be a perfect sine wave processed with perfectly linear components, then perfectly sampled at the A/D conversion. Any nonlinearity distorts a signal. Harmonics start showing up with sine waves at integer multiples of the fundamental wave summing together. The squarer a wave gets, the more powerful 2nd, 3rd, 4th, and higher-order harmonics it contains.
Figure 1 A frequency-domain view of a signal is shown along with its harmonics, spurious signals, and noise. Source: NF Corp.
Filtering can be analog, digital or both
Now, coming to the fix strategy for each category of problem.
- White noise underneath a strong enough signal can be averaged out by oversampling, moving averages or other techniques, while taking advantage of statistical randomness.
- Spurious signals in the bandwidth of the signal of interest need to be resolved close to their source; otherwise, an A/D converter just digitizes and mixes them with the signal of interest.
- Harmonics can be dampened by filtering an A/D converter, undoing some of the effects of nonlinearity.
Filtering can be a complex topic, even for experienced designers. Rather than trying to design specific filters here, let’s look at what filtering should try to do. Filtering can be in analog, before the A/D input, or in digital after the conversion happens. The sample rate of an A/D converter is typically set to at least twice the highest frequency of the signal of interest—the Nyquist criteria. Often, that sample rate is set higher for margin.
An analog low-pass filter should match the selected A/D sample rate. It allows signals in the bandwidth of interest to get through and cuts off anything at higher frequencies—noise, spurious or harmonics. That process is imperfect, however. For instance, there may be ripples in the pass-band, and the cutoff may not be ideally sharp. An analog filter injects a slight phase delay and takes time to settle, which can affect the A/D converter’s ability to sample and settle properly. As discussed in a previous piece, active drivers with filtering around them may be preferable to passive filtering.
A digital low-pass filter has advantages of programmability and no external components required. On the downside, it injects more latency, and depending on the implementation, it can add some quantization noise. Digital filtering also does noise reduction in hardware, taking some computational load away from software. If decimation from oversampling is applied, an analog filter may be required to rid the signal of an aliased artifact.
A design article from Analog Devices goes deeper into these A/D filtering pros, cons, and tradeoffs.
Figure 2 This is how a simple A/D filtering chain looks like. Source: Analog Devices
Most of what’s needed may already be in place
The good news is that if the A/D input is being scaled, adding analog filtering is straightforward since there is already an amplifier present. Smart sensors are also integrating digital filtering, and all the maker needs to do is turn it on, select parameters, and get filtered results.
Cleaning up A/D conversion with filtering helps applications with continuous signaling, so power consumption is less of a concern. For makers working with audio, video, or any higher-speed signals needing capture, picking up an A/D filtering technique is a good idea.
After spending a decade in missile guidance systems at General Dynamics, Don Dingee became an evangelist for VMEbus and single-board computer technology at Motorola. He writes about sensors, ADCs/DACs, and signal processing for Planet Analog.
- Using an analog filter to inject noise
- ADC Noise: More on the Analog Inputs
- ADC Noise: Where Does It Come From?
- Analyzing ADC Noise Impacts on Wireless System Performance
- 16-Bit, 80-Msps ADC offers noise reduction in data conversion systems