# Anti Aliasing: Where Would We Be Without It?

To achieve optimum results from digitized data acquisition systems, engineers must keep in mind that they are dealing with the analog world through a sampled-data process. That sampling process imposes restrictions on the input signal spectrum that can be applied to the system’s analog-to-digital converter (ADC). Consequently, an engineer must pay very careful attention to the front-end analog (antialiasing) filtering that precedes any data conversion.

Whether an engineer designs the filters himself or buys filter modules, he must understand the role a presampling filter plays in a digital signal-acquisition system. When digitally sampling a dc system, a good filter eliminates noise but allows a change in signal to settle out in a reasonable time.

To digitally acquire ac signals, presampling filtering is even more critical. Without antialiasing filters, an engineer can’t distinguish useful information from mathematical aberrations.

**SIGNAL ALIASING**

When a continuous signal is sampled, the frequency spectrum is duplicated, or aliased. The center-to-center separation between aliases is equal to the sampling frequency. If the sampling function is fast compared to the sampling period, the duplication repeats into infinity. A continuous signal containing frequencies between [-f.sub.h] and [+f.sub.h], when sampled at [f.sub.s], contains the frequencies [nf.sub.s],[-f.sub.h] to [nf.sub.s], + [f.sub.h], where n goes from -infinity to infinity Fig. 1).

To reconstruct the continuous time signal, or to reliably analyze the frequency components of the signal, the aliases can’t overlap. The gap between edges of the aliases depends on the bandwidth of the continuous time signal and the sampling frequency. The highest frequency of the continuous signal’s [f.sub.h], and the lowest frequency of the first alias is [f.sub.s] – [f.sub.h]. The gap is the difference between these two frequencies, or [f.sub.s], – [2f.sub.h].

The limit for signal analysis occurs when the gap between aliases reaches zero, but the aliases don’t yet overlap. This happens when [f.sub.h] = [f.sub.s]/2, otherwise known as the Nyquist frequency. The aliases will overlap if the sampling frequency is lower or the signal bandwidth is higher, making it impossible to draw meaningful conclusions from the sampled signal.

The signal profile under consideration results from a white-noise source filtered by a perfect low-pass filter. Such a filter passes all frequencies up to the cutoff ([f.sub.c] = [f.sub.h]), and completely blocks all others. Every practical filter, however, has a noticeable roll-off between the pass band and stop band. These filters will pass each frequency, virtually without distortion, up to some corner frequency.

The filter then attenuates increasing frequencies at a faster rate. Some filters have a limit in the maximum attenuation, which will be discussed later. The effect of the roll-off must be considered when relying on such a filter to eliminate aliasing errors.

**FILTER TYPE**

It can be seen that the gap between aliases shrank because of the imperfect filtering. The amount of the shrinking is a function of the filter’s roll-off. If the imperfectly filtered signal is sampled too slowly to compensate for the roll-off, the signals begin to overlap. When this happens, aliasing occurs. Either the filter must be improved or the sampling frequency must be increased.

In the ideal case, a low-pass filter completely eliminates frequencies above the cutoff and perfectly passes frequencies below it. The range of frequencies passed is called the pass band, all others are called the stop band. All real filters, however, have a transition band where the attenuation increases but hasn’t yet reached the stop band. Some filters have a ripple, or variation, in the response in the pass band. Some filters also have a limit to the amount of attenuation present in the stop band. For realizable filters, designers need to balance pass-band ripple, transition band roll-off, and stop-band attenuation. At this point, it’s helpful to compare the responses of three common types of low-pass filters used in data conversion applications.

Butterworth filters provide completely flat response in the pass band. Above the break frequency, filter attenuation continuously increases by 6 dB per octave, or 20 dB per decade for each pole of the filter.

Chebyshev filters deliver a slightly faster roll-off overall than Butterworth filters, and the roll-off at the break frequency is sharply higher. The increased roll-off comes at the price of ripple in the pass band.

Elliptic filters offer the steepest transition band at the expense of ripple in both the pass band and stop band. The stop-band ripple imposes a finite limit on the maximum attenuation of the filter.

**NOISE FILTERING**

Butterworth and Chebyshev filters are both used for noise filtering. Specifying filter characteristics depends on the application. First, the maximum allowable error from the filter must be determined. The error is usually specified as a function of the size of the least significant bit (LSB) of an ADC, typically 1/2 LSB. At this level, the filter doesn’t introduce any noticeable error to an ADC measurement.

Second, the worst noise source in the system should be examined. In most cases, it’s either 60-Hz noise from power lines or broad-band noise from switching power supplies. Then the minimum attenuation the filter needs to supply at the noise frequencies should be determined. Ideally, this specification would allow enough attenuation to remove all noise from the digitized signal, even if the noise level was as large as the signal. Thus, the attenuation is related to 1/2 LSB of the ADC.

Third, the corner frequency and the number of poles for the noise filter can be selected from the required attenuation and noise frequency. For example, a 12-bit ADC system requires a filter attenuation of 78 dB at 60 Hz. A four-pole Butterworth filter rolls off at 80 dB per decade, a four-pole Chebyshev slightly faster. If the break frequency is placed one decade below 60 Hz, the goal is achieved. As a result, our first estimate of filter parameters is a fourpole Butterworth filter with break frequency of 6 Hz.

To ensure that this filter works, the step response of the system with the filter in place should be confirmed. Even though the signal is assumed to be dc, a change in level must be responded to within a reasonable time, with the response again better than 1/2 LSB. The step response of an n-pole Butterworth filter with corner frequency of f is given in equation 1. Substituting err for 1-[V.sub.out]/[V.sub.in] in equation 1 and solving for time yields equation 2, which determines the settling time for a low-pass Butterworth filter.

(1) [V.sub.out]/[V.sub.in] = 1 – [e.sup.(-ft/n)

(2) t = (n/f)[In(err)]

For a 12-bit system, a 1/2 LSB error equals 1-(40955/40960), or 1.221 X 10-4. This yields a settling time of about 6 seconds. If the settling time is too long, either use a higher order filter (more poles) or accept less attenuation at 60 Hz.

**ANTIALIASING FILTERS**

Filtering out alias frequencies but passing frequencies of interest requires filters with steeper roll-offs than Butterworth or Chebyshev filters. The filter type most often used is a Cauer elliptic filter. These filters offer the steepest roll-off of any commonly available filter and have a maximum attenuation limit in the stop band. In comparison, Butterworth and Chebyshev filters have an ever-increasing attenuation until stray capacitance begins to shunt signals around the filter.

Elliptic-filter performance stems from pole placement on an oval about the origin of the s-plane, much like a Chebyshev filter. Elliptic filters also include a pole pair on the imaginary axis at a frequency greater than the corner frequency of the filter. These poles are responsible for the sharp roll-off of these filters.

Poles on the imaginary axis present a challenge to building stable elliptic-filter circuits. If component variation causes a pole to drift into the right half of the s-plane, the circuit becomes unstable.

Four parameters are important when specifying an elliptic filter. First, like Chebyshev filters, elliptic filters exhibit a ripple in the pass band. The ripple is usually specified in decibels.

Then the corner frequency is specified in hertz. The corner frequency is defined as the point the filter response curve last passes through the specified pass-band ripple. The corner frequency is only -3 dB in elliptic filters.

**SPECIFYING ATTENTUATION**

Next, the shape of the transition from pass band to stop band must be given. The specification may be an attenuation at a particular frequency on the slope, or it may be the frequency where the stop band should start.

Lastly, the attenuation floor must be specified. Elliptic filters have a maximum attenuation limit, and that limit should ensure 1/2 LSB performance.

When matching an elliptic filter to an application, the frequencies being analyzed, the ADC’s precision, and the sampling speed must be taken into account. For example, start by considering the highest frequency of interest, 10 kHz.

This sets the corner frequency of the elliptic filter at 10 kHz. Assuming a 12-bit ADC, a maximum stop-band ripple of -78 dB is needed. The attenuation floor should also be down at least -78 dB.

With the pass-band ripple and stop-band attenuation determined, all that remains to characterize the filter is specifying the filter’s roll-off in the transition zone. This roll-off depends on the sampling speed.

**DESIGN OR BUY?**

If an input signal contains frequency components that are faster than half the sampling frequency, the resulting digitized signal contains aliases. The minimum sampling frequency is therefore twice the frequency in which the filter’s stop-band attenuation reaches 78 dB, not twice the frequency to be analyzed. If the speed of the ADC was already selected, a filter that satisfies this criteria must be selected or a designer must settle for a lower frequency to analyze. If the ADC system is still being selected, then sampling speed is controllable. In many cases, a faster ADC system costs less than a steeper filter.

Once the characteristics are determined for the required filter, an engineer must decide whether to design the filter himself or to buy one. Good filters are expensive because building filters to meet specifications is a specialized business. Rarely is it worth the time and effort to build filters when only a couple are needed.

If an engineer is designing a product for resale or needs many of the same type of filter, then designing his own may be worthwhile. However, a big problem in roll-your-own design is that filter response is very sensitive to component values. The component values generated from design equations must be used exactly, even if the values aren’t standard.

As an example of a low-pass filter design, consider a 12-bit data-acquisition system with an input signal-to-noise ratio of 10 dB, and a noise source at 60 Hz. A filter is needed that attenuates the noise source below the ADC’s resolution.

Also needed is a full-scale step change of the input to settle to within 1/2 LSB in less than 5 seconds. Because a flat response is desired in the pass band, a Butterworth filter would be the best choice.

An acceptable maximum signal-to-noise ratio after filtering is 78 dB (1/ 2 LSB for a 12-bit system). Because there’s already a signal-to-noise ratio of 10 dB, the filter has 68 dB of attenuation at the noise frequency to meet specification.

**CHECKING STEP RESPONSE**

As a starting assumption, the corner frequency of the filter is set three octaves below the noise frequency to 7.5 Hz. This sets the minimum filter roll-off at 68 dB in three octaves, or 22.67 dB per octave. With each pole of a Butterworth filter contributing 6 dB per octave, at least a four-pole Butterworth filter is required.

Once the corner frequency and the number of poles are set, the step response time can be checked for the filter using equation (2). The maximum error (err) allowed is [-I(40955/ 40960)], which yields a step response of 4.8 seconds.

If a faster response time was required, a six-pole filter with corner frequency at 15 Hz yields a step response of 3.6 seconds. Though the step responses sound slow, they’re probably acceptable for monitoring environmental variables, such as temperature.

The response time assumes a full change step in the input. This step is unrealistically conservative in most applications.

With the filter characterized, a circuit must be designed to synthesize the desired response. One approach is to use two second-order filter sections based on the state-variable filter topology.

Each second-order filter section consists of two integrators and a summing amplifier connected in a feedback loop. The stage’s corner frequency is determined by the RC time constants of the integrators. A multiple-amplifier package helps realize the filter in a compact space.

**REALIZING A DESIGN**

A good choice is Burr-Brown’s UAF41, a quad op-amp package with additional internal components to synthesize active filters. One op amp serves as an input summing amplifier, two op amps function as integrators, and the fourth op amp is uncommitted. The natural frequency and Q of the filter section are determined by user-supplied external resistors. The uncommitted fourth op amp may be used as an output buffer to eliminate the loading effects of subsequent circuitry. It’s essential that the second filter stage isn’t loaded by subsequent circuitry.