Often when we hunt for problems with noise or instrument performance we overlook ourselves as culprits. This collection of tips will help you find basic problems that you or your colleagues caused:
· Sample Data at the Proper Rate
An incorrect sampling rate can cause the digital representation of your original signal to include unexpected signals. Sample rates often reach five to 10 times the frequency of the smallest signal your ADC can detect. (See graph, below.)
· Use an Anti-Alias Filter
This type of filter will attenuate noise and other signals so they don't affect digitized data. A Bessel filter, for example, offers a linear phase delay that preserves the phase relationships between frequency components in a signal. But this type of filter has a slow "roll off," which means as signal frequencies increase, attenuation does not occur as rapidly as in other filters. A Butterworth filter, on the other hand, offers faster roll-off, but its phase delay becomes nonlinear near its cut-off frequency. So at these higher frequencies, it does not preserve signal-phase relationships.
· Use an FFT Window Function
To get more useful information from a fast Fourier transform, use a window function to remove discontinuities at the start and end of data sets. The window adjusts a data set so the first and last point have about the same amplitude. This technique makes the data set look like samples from a continuous signal and it attenuates side lobes in the FFT's frequency versus magnitude output. Experimenting with several types of window functions leads to a good choice.
· Identify off-by-One Errors
Engineer A specifies a data array with elements numbered 0 to n. Engineer B, though, assumes an array of elements from 1 to n+1. The common mismatch error creates an unexpected value, or "noise," at the start or end of an array. People often miscalculate the number of passes through a processing loop, too.
· Don't Mix Data and Results
A colleague wrote a moving average, or FIR-filter routine that took a raw value from an array, filtered it, and then replaced the raw value in the array with the filtered value. So, the already-filtered values got used to filter the subsequent raw values. This problem proved difficult to find. Set up one array for raw values and another for processed values. (Some analog filters and an infinite impulse-response filter use feedback, but as part of
an algorithm or circuit.)
For more information:
1. "Understanding Digital Signal Processing,"
Second Edition, Richard G. Lyons
2. "Analog & Digital Filter Design Guide"
3. "Choose a Sample Rate,"
Design News, Sept. 2008
4. "Sample Rates Revisited,"
Design News, Oct. 2008
5. "Pass Data through a Window,"
Design News, Nov. 2007
for a larger version