DA & Control

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:

equation (1)

equation (2)


ω0  =  2*π*cutoff frequency
R1  =  resistance of resistor 1
R2  =  resistance of resistor 2
C1  =  capacitance of capacitor 1
C2  =  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.


Click for larger image Figure 2. Second-order step response vs. Q  (Click image for larger version)


Click for larger image Figure 3. Second-order low-pass filter transfer function  (Click image for larger version)

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 R1 and R2 to have the same value R, we can simplify Equations 1 and 2 to give Equations 3 and 4:

equation (3)


equation (4)

With these new equations the design procedure becomes:

  1. Choose Q, ω0, and R and calculate C1 and C2


  2. If values for C1 and C2 are impractically low, choose a higher value for R and repeat step 1


  3. If values for C1 and C2 are impractically high, choose a lower value for 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 C1 and C2. Substituting standard capacitances close to these ideal values into the equations, you recalculate to discover whether the resulting values of Q and ω0 are sufficiently close to their initial, desired values.

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.


Click for larger image 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 R1=R2=24k results in the calculated values for C1 = 2.21 nF and C2 = 3.18 nF. After choosing standard values for the components, C1 = 2.2 nF and C2 = 3.3n F, the resulting ω0 and Q must be calculated again. This is done using the original Equations 1 and 2 and results in Q = 0.61 and ω0 = 15464 rad/s, corresponding to a cutoff frequency of 2.46 Hz. These are very close to the original, targeted values of Q and ω0.

The function of network R3 C3 is described later in this article.

Fixed-Gain, Second-Order Sallen-Key Low-Pass Filters
In a fixed gain system, K>1 and C1 and C2 can be chosen in a certain ratio. This can help to simplify Equations 1 and 2. Substituting   into these equations gives Equations 5 and 6:

equation (5)

equation (6)

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

equation (7)

equation (8)

With these new equations the design procedure becomes:

  1. Choose R1


  2. Choose Q and calculate R2


  3. Choose ω0 and calculate C1 and from C1 calculate C2


  4. If the values of C1 and C2 become impractically low, decrease R1 and start again at step 2


  5. If the values of C1 and C2 become impractically high, increase R1 and start again at step 2

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 R4 and R5 such that R4=(gain–1) R5 .


Click for larger image 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 R2, C1, and C2 can be calculated using Equations 7 and 8. For this example we use Q = 0.6. We choose a cutoff frequency of 2.5 kHz or ω0 = 15708 rad/s. Using a chosen value for R1 = 10K will result in the calculated values R2 = 6.9 kΩ, C1 = 15.3 nF, and C2 = 3.82 nF. After selecting standard values for the components R2 =6.8 kΩ, C1 = 15 nF, and C2 = 3.9 nF, the resulting ω0 and 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 R3 C3
In the final circuit, the network R3 C3 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 Figure 6, is valid for both design examples. The curves are normalized and show relative responses.


Click for larger image Figure 6. Frequency responses of the example filters  (Click image for larger version)

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 R3 and C3. As explained earlier, the signal in the filter's passband is not changed by the network R3, C3. It just adds some additional filtering for high frequencies, which is very desirable.

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 (Figure 7) for quickly calculating the cutoff frequency and Q of these filters. After opening the sheet, enter the gain, cutoff frequency, and Q in the yellow cells. The mathematical values of the parts for the filter are calculated in the white cells. Choose standard components based on the mathematical values and enter their values and tolerances in the green fields of the spreadsheet—the resulting cutoff frequency and Q are automatically calculated.


Figure 7. National Semiconductor's Filter Calculator estimates cutoff frequency and Q

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.

Add Comment




Twitter Feed

Find It Fix It Forum

Sensors invites you to join the Findit-Fixit Forum, where you can get answers to your sensing questions—concerning technologies, products, methods, applications, and services--and also offer help to your fellow engineers. The Forum covers all kinds of topics, from the basics to the extraordinary.

Join the discussion!

© Copyright 2016 Questex, LLC. All Rights Reserved. Sensorsmag. Privacy Policy | Terms of Use

If you are having technical difficulties or considerations, please contact the webmaster.