Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Measure Your Filter's Characteristics

Once you understand the differences between filters, you can make corrections to take precise measurements.

Chao-Sun Pang, RC Electronics, Santa Barbara, CA -- Test & Measurement World, 4/1/1999

Data-acquisition systems frequently use analog filters to reduce errors caused by aliasing. If your system uses a low-order antialiasing filter, or if you don’t know the characteristics of your filter, then you could collect inaccurate data. By running three tests in the time domain and in the frequency domain, you can learn which filter the manufacturer installed, or if you even have a filter.

Data-acquisition systems often include Bessel, Butterworth, or Cauer (elliptical) analog filters to minimize aliasing. The three types of low-pass analog filters have different characteristics (see Table 1). Some have sharper cutoffs than others but may introduce errors on their pass bands. Some amplify their input signals near the cutoff frequency while others attenuate signals there. (Some systems use Chebychev filters, but we won’t discuss them in this article.)

04T2Table1.gif (14074 bytes)

Systems that use sigma-delta analog-to-digital converters (ADCs) may also use digital filters to further process the signals. But digital filters can’t minimize aliasing, so you still need an analog filter ahead of the system’s ADC.

To test the filters, you’ll need a function generator, and you should have software in your data-acquisition system that can display digitized analog signals in graphic format (a scope-like display). If your system doesn’t have such software, you can export the data to a spreadsheet.

Test 1 helps you identify the filter type. Generate a square wave with a frequency that’s low relative to the filter’s cutoff frequency, as listed in the data-acquisition system’s specs. Typically, the filter’s cutoff frequency will be in the tens to hundreds of kilohertz. For a 1-kHz filter and a 10-kHz sample rate, we suggest using a 5-V, 20-Hz square wave. That will produce the results in Figure 1 and Table 2. Table 2 shows that you can identify the filter by the amount of ringing at the edges of the square wave.

04t2fig1.gif (38502 bytes)
Figure 1. In the top row, different filter types distort rising and falling edges and shoulders of a square wave. The bottom row shows the power spectrum of these filtered square waves and demonstrates how rapidly the filters attenuate a signal’s frequency components.


04T2Table2.gif (16094 bytes)

Thus, by simply looking at the ringing produced by a square-wave, you can find which filter type—Cauer, Butterworth, Bessel, linear phase—you have. Just knowing which type of filter you have, however, won’t help you collect accurate data. You need more tests.

The next test lets you view the filter’s frequency response. For Test 2, use a fast Fourier transform (FFT) of a digitized square wave to produce a frequency plot that will reveal the filter’s rolloff. The rolloff will tell you if your filter is providing enough protection against aliasing.

To perform the frequency-response measurement, produce a square wave at a low frequency. In our tests, we used the same square wave that we used in Test 1. Capture about one cycle of the square wave and perform an FFT on the data. If your system samples at 10 ksamples/s (100 ms per sample) and you perform a 512-point FFT, a single cycle period will be 5.12 ms (100 ms x 512) or 19.5 Hz.

Filtering with an FFT
When you generate a power spectrum plot from the FFT, you get a display of how the filter rolls off as frequency increases (bottom row of Figure 1). Figure 1 also shows that a Cauer filter’s output reaches the noise floor at around 1.5 kHz. The Butterworth filter’s output hits the noise floor at 2 kHz, the Bessel filter’s output takes until about 3.5 kHz to reach that level, and the linear-phase digital filter reaches the noise floor at 1.25 kHz.

The FFT gives you a good visual representation of your filter’s cutoff frequency and rolloff. The graphs also indicate whether or not your filter is adequate. If you have a system with a filter that doesn’t remove all signal frequency at half of your sampling rate, you’ll have trouble with aliasing. Because we used a 10-kHz sampling rate, the filter must attenuate all signals with frequencies of 5 kHz and above to the noise floor.

Even if your filter’s output rolls off well below half your sampling rate, the filter may not faithfully reproduce the signal that’s in the filter’s passband. The results from Test 3 can provide the missing information.

To perform this test, alter the frequency of a sine wave and measure either the peak-to-peak voltages or rms levels. If you sweep the frequency of a sine wave from 100 Hz to 4 kHz, you’ll get results like those in Table 3. Because we chose to measure RMS volts, a measurement of 0.707 V indicates no attenuation by the filter.

04T2Table3.gif (10284 bytes)

Although Test 3 uses a sine wave and Test 2 used a square wave, these measurements provide similar rolloff readings. Test 3, however, also provides passband information that the rolloff test can’t. Note that for the Cauer filter, the measured RMS voltage is higher at 900 Hz than at 100 Hz. That indicates that a Cauer filter’s response falls within the passband.

Although the Bessel filter’s frequency response fell to the noise floor adequately in Test 2, the filter attenuates the signal and doesn’t give a faithful reproduction of the signal in its passband. The Bessel filter’s response doesn’t roll off as quickly above the 1-kHz cutoff frequency as do the Cauer and Butterworth filters (Table 2). The linear-phase digital filter has the sharpest cutoff. While you do need an analog filter, you can use a digital filter to compensate for limitations on it. (continued)

So far, we’ve assumed that your data-acquisition system has a filter, but not all do. If your system has no filter, then Test 1 will show a perfect square wave similar to the Bessel filter. If you compare the Bessel filter’s square wave output to an unfiltered one, you’ll find the risetime of the unfiltered signal is faster than the risetime of a Bessel filter. The square wave on the left side of Figure 2 looks the same as the square wave for the Bessel filter in Figure 1. (The graphs shown lack the resolution to view the difference in risetimes.)

The lack of a filter will also affect the results of Tests 2 and 3. With no filter, Test 2 will produce a flat line to 5 kHz after an initial decay (Fig. 2). When you perform Test 3 with no filter, you’ll get inconsistent measurements because the sine wave has frequency components that exceed half of your maximum sampling rate (5 kHz in this example). Those inconsistencies are caused by aliasing.

04t2fg2a.gif (2550 bytes)
Figure 2. Spectrum of a 20-Hz square wave sampled at 10 kHz with no filter.

Although the Bessel, Butterworth, Cauer, and linear-phase delay filters are accepted anti-aliasing filters, none are perfect. If your filter doesn’t remove all signal frequency above one-half of your sampling rate, your anti-aliasing filter won’t provide adequate protection. If your filter doesn’t hold a steady signal in the passband, your system will lose accuracy.  T&MW

FOR FURTHER READING
Pang, Chao-Sun, “Anti-Aliasing Filters and Data Validity—The Inside Story,” Sound and Vibration, Acoustical Publications, Bay Village, OH, April 1998.
Wright, Chuck, “Preserving an Input’s Frequency Content or WaveShape,” Personal Engineering and Instrumentation News, PEC, Rye, NH, February 1992.

Chao-Sun Pang holds a B.S. in Physics and an M.S. in Scientific Instrumentation from the University of California at Santa Barbara. He currently is the vice president of marketing at R.C. Electronics. chaop@rcelectronics.com.

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

By This Author

There are no other articles written by this author.

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    May, 9 2008
    Upgrades include blood pressure
    Every time I install new or upgraded software on my home computers, I can feel my blood pressure ris...
    More
  • Rick Nelson
    Taking the Measure

    May, 6 2008
    Measurement drives green engineering
    Have we reached peak oil? I guess we know where Paul Rako stands on that question, but other observe...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS
Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites