# Designing a Second-Order Anti-aliasing Filter for a Sensor Signal Path

August 1, 2009 By: Beb Hennink, National Semiconductor Corp. Sensors### Aliasing in sensor signal paths can be avoided by using an anti-aliasing filter between the sensor and the ADC. This article describes how to design a simple, second-order anti-aliasing filter.

Sampling signal path systems must comply with the Nyquist criteria and therefore require the bandwidth of the amplified sensor signal applied to an ADC to be less than half the ADC's sampling frequency. This avoids aliasing effects that cause unwanted higher-frequency signals to fold back into the desired frequency band where they appear—erroneously—as a desired signal. Using an anti-aliasing filter as part of the signal chain from the sensor to the ADC avoids this problem. This article describes how to design an anti-aliasing filter for a sensor signal path and presents a filter calculation tool (see sidebar "Filter Calculator") used for calculating cutoff frequency and Q.

Some applications, such as the pressure sensor signal path found in the WEBENCH Sensor Designer, use a first-order, low-pass filter. For higher-resolution systems, better filtering is required because first-order filters have a slow roll-off—a big disadvantage because the higher-frequency desired signals (which carry most information) are attenuated by the filter. In addition, the unwanted signals—those outside the desired bandwidth—will not be sufficiently attenuated.

A higher-order low-pass filter can have a sharper cutoff and steeper roll-off, resulting in less attenuation for desirable signals and greater attenuation of undesirable signals. Therefore, a system with a higher-order filter will, in general, perform better and provide higher resolution. The second-order Sallen-Key low-pass filter—shown in **Figure 1**—is a good example of such a filter. This particular filter topology is a degenerate form of a voltage-controlled voltage-source (VCVS) filter topology introduced by R.P. Sallen and E. L. Key of MIT's Lincoln Laboratory in 1955 and is chosen for both its simplicity and its noninverting transfer function. A step-by-step guide for calculating the filter's component values follows.

Figure 1. Schematic diagram of the low-pass filter |

The parameters *ω _{0}* (2*π*cutoff frequency) and quality factor (

*Q*) determine the behavior of the filter and can be calculated using

**Equations 1**and

**2**:

(1) |

(2) |

where:

ω_{0} |
= | 2*π*cutoff frequency |

R_{1} |
= | resistance of resistor 1 |

R_{2} |
= | resistance of resistor 2 |

C_{1} |
= | capacitance of capacitor 1 |

C_{2} |
= | capacitance of capacitor 2 |

Q |
= | quality factor |

K |
= | gain |

For a second-order filter, the value chosen for *Q* will determine the filter's step response, shown in **Figure 2**, while its frequency response is shown in **Figure 3**. The filter's *Q* determines how much overshoot will occur as well as the damped waveform's settling time. A lower *Q* will give a slow-rising step response without overshoot or ringing. *Ringing* is the decaying oscillation on the filter's output signal, at the natural frequency of the filter, as a result of a step function at the input. A higher *Q* will result in a faster rising step response with more overshoot and longer ringing.

Overshoot can drive an ADC into saturation, thereby creating an erroneous reading. A higher *Q* will also make the filter more vulnerable to component tolerances that, in combination with higher gains, might cause instability that manifests as an oscillating signal at the output. The filter calculation tool presented later in this article warns when such situations arise. Generally speaking, using a *Q* between 0.5 and 1/√2 gives a good compromise between rise time and settling time.

A very low *Q* will result in a slower roll-off in frequency response, as shown in Figure 3. For comparison purposes, the transfer function is plotted for a first-order filter. This filter has its 3 dB attenuation point (cutoff frequency) at the same frequency as the *Q* = 0.5 filter, showing the difference in roll-off between a first- and second-order filter.

**Unity-Gain, Second-Order Sallen-Key Low-Pass Filters**

In a unity-gain system, *K*=1. For this case, if we choose *R _{1}* and

*R*to have the same value

_{2}*R*, we can simplify Equations 1 and 2 to give

**Equations 3**and

**4**:

(3) |

and

(4) |

With these new equations the design procedure becomes:

- Choose
*Q*,*ω*, and_{0}*R*and calculate*C*and_{1}*C*_{2} - If values for
*C*and_{1}*C*are impractically low, choose a higher value for_{2}*R*and repeat step 1 - If values for
*C*and_{1}*C*are impractically high, choose a lower value for_{2}*R*and repeat step 1

Note that, in general, capacitors with a value between 100 pF and 2.2 µF are practical values while for resistors the practical values lie between 1k and 100k.

To summarize the design process, starting from desired values for *Q*, *ω _{0}*, and using a standard resistor value, you use the equations to calculate the corresponding ideal values of

*C*and

_{1}*C*. Substituting standard capacitances close to these ideal values into the equations, you recalculate to discover whether the resulting values of

_{2}*Q*and

*ω*are sufficiently close to their initial, desired values.

_{0}By using a low-power operational amplifier such as National Semiconductor's LMP2231 or LMV651 in 1x gain configuration, the filter can fit in the application as illustrated in **Figure 4**.

Figure 4. Second-order low-pass filter with 1x gain, replacing RS1 and CS1 (Click image for larger version) |

For our first design example, we use a value *Q* = 0.6. For the cutoff frequency, we choose 2.50 kHz or *ω _{0}* = 15708 rad/s. Using a standard resistor value

*R*=

_{1}*R*=24k results in the calculated values for

_{2}*C*= 2.21 nF and

_{1}*C*= 3.18 nF. After choosing standard values for the components,

_{2}*C*= 2.2 nF and

_{1}*C*= 3.3n F, the resulting

_{2}*ω*and

_{0}*Q*must be calculated again. This is done using the original Equations 1 and 2 and results in

*Q*= 0.61 and

*ω*= 15464 rad/s, corresponding to a cutoff frequency of 2.46 Hz. These are very close to the original, targeted values of

_{0}*Q*and

*ω*.

_{0}The function of network *R _{3} C_{3}* is described later in this article.

**Fixed-Gain, Second-Order Sallen-Key Low-Pass Filters**

In a fixed gain system, K>1 and *C _{1}* and

*C*can be chosen in a certain ratio. This can help to simplify Equations 1 and 2. Substituting into these equations gives

_{2}**Equations 5**and

**6**:

(5) |

(6) |

For an amplifier with a gain *K* = 5, the resulting formulas have the form of **Equations 7** and **8**:

(7) |

(8) |

With these new equations the design procedure becomes:

- Choose
*R*_{1} - Choose
*Q*and calculate*R*_{2} - Choose
*ω*and calculate_{0}*C*and from_{1}*C*calculate_{1}*C*_{2} - If the values of
*C*and_{1}*C*become impractically low, decrease_{2}*R*and start again at step 2_{1} - If the values of
*C*and_{1}*C*become impractically high, increase_{2}*R*and start again at step 2_{1}

In our second design example, a low-offset operational amplifier such as the LMP7715 is used to create a 5x gain Sallen-Key low-pass filter such as that illustrated in **Figure 5**. The gain of the filter is set with *R _{4}* and

*R*such that

_{5}*R*=(gain–1)

_{4}*R*.

_{5}

Figure 5. Second-order low-pass filter added between sensor pre-amplifier and ADC (Click image for larger version) |

The top half of Figure 5 shows a typical application with a first-order filter in the signal path between the sensor and ADC. This first-order filter is easily replaced with a second-order filter as shown in the schematic drawing.

As described in the design procedure, the calculations start with choosing a value for R1. The values for *R _{2}*,

*C*, and

_{1}*C*can be calculated using Equations 7 and 8. For this example we use

_{2}*Q*= 0.6. We choose a cutoff frequency of 2.5 kHz or

*ω*= 15708 rad/s. Using a chosen value for

_{0}*R*= 10K will result in the calculated values

_{1}*R*= 6.9 kΩ,

_{2}*C*= 15.3 nF, and

_{1}*C*= 3.82 nF. After selecting standard values for the components

_{2}*R*=6.8 kΩ,

_{2}*C*= 15 nF, and

_{1}*C*= 3.9 nF, the resulting

_{2}*ω*and

_{0}*Q*must be calculated again using the original Equations 1 and 2.

This calculation gives *ω _{0}* = 15855 rad/s, which corresponds to a cutoff frequency of 2.52 kHz and

*Q*= 0.66, which are close to the target values.

**The Network R_{3} C_{3}**

In the final circuit, the network

*R*remains from the original filter at the output of the second stage. This network is kept to reduce the effect of the switching capacitive load at the input of the ADC. The network's cutoff frequency can be chosen to be much higher than in the original schematic to ensure that the network will not influence the frequency characteristics of the designed filter. In this case, the cutoff frequency is 15 kHz, which is far above the range of interest. Therefore, it does not have any influence on the passband behavior of our filter. Moving the network's cutoff frequency closer to that of the calculated filter will give more out of band attenuation but it will also give more attenuation at the end of the required passband. The resulting frequency response, highlighted in

_{3}C_{3}**Figure 6**, is valid for both design examples. The curves are normalized and show relative responses.

In Figure 6, the first-order signal is added as a reference. This shows how the designed filter will behave compared to a first-order R/C filter. The signal *Q* = 0.6 is the amplifier's output signal plus the second-order low-pass filter. The signal OUT-ADC is the signal after *R _{3}* and

*C*. As explained earlier, the signal in the filter's passband is not changed by the network

_{3}*R*,

_{3}*C*. It just adds some additional filtering for high frequencies, which is very desirable.

_{3}**Conclusion**

Having a good anti-aliasing filter is essential for the operation of an effective sampling system. A second-order low-pass filter is well suited for this task and is often considered a difficult part of a design. The described second-order Sallen-Key low-pass filter is a good example of such a filter. The design can be a straightforward task when first choosing *Q* and cutoff frequency; if proper assumptions are made on the right component ratios, the calculation of the remaining components can be done with simple arithmetic.

Filter Calculator
National Semiconductor's Excel-based filter calculator can be helpful (
A warning will be given if the filter—realized with the selected component values and their tolerances—has a high potential for instability. If another filter configuration is desirable, the WEBENCH filter designer tool could be a good starting point. The provided Excel sheet calculation tool will do the calculations work and can indicate the worst-case effect of component tolerances. |

Most Read Articles

Bookmark it:digg del.icio.us technorati yahoo facebook twitter