Main Content

Design Anti-Aliasing Filter for Analog-to-Digital Converters

This example shows how to design an analog anti-aliasing filter that you can use with an analog-to-digital (A-to-D) converter (ADC). The filter cut-off frequency is 500 Hz, corresponding to the Nyquist frequency which is half the ADC sampling frequency of 1 kHz. The test signal incorporates a desired 50 Hz sinusoid and a higher frequency component at 1100 Hz that you cannot capture with a 1 kHz A-to-D sampling frequency. The scope shows the captured signal with and without anti-aliasing. With the anti-aliasing filter, the ADC correctly measures the 50 Hz sine wave with an amplitude of 1 volt and a DC offset of 1.5 V.

Visualize Aliasing of High-Frequency Component

Aliasing occurs when a signal contains frequencies above half the ADC sampling rate. Aliasing causes low-frequency components to appear in the reconstructed signal that are not present in the original signal. The alias frequency is the absolute difference between the sampling frequency and the input frequency.

This plot shows a visualization of aliasing in the time domain. If you sample a 1100 Hz voltage signal at 1000 Hz, the reconstructed signal is a 100 Hz sinusoid. An analog anti-aliasing filter attenuates high-frequency components in the analog signal before the ADC samples and converts the signal into a digital signal to remove aliased components from the output signal.

Open Model

Open the model. The filter has two stages. Each stage has a Sallen-Key topology which uses a Band-Limited Op-Amp block, Resistor blocks, and Capacitor blocks to create a second-order lowpass filter. Cascading two stages results in a fourth-order filter, which provides a steeper roll-off. This design uses 10000 ohm resistors. The capacitance values give the correct transfer coefficient for a fourth-order Bessel filter. For more information about calculating the capacitances or to edit the filter parameters, at the MATLAB® Command Window enter edit AnalogAntiAliasingFilterInputParameters.

The DC Voltage Source block and two AC Voltage Source blocks provide the test signal. The DC Voltage Source block sets the DC offset to 1.5 V. The AC Voltage Source block labeled Vac1 provides the unwanted 0.5 V component at 1100 Hz. The AC Voltage Source block labeled Vac2 supplies the 1 V component at 50 Hz.

The masked subsystems ADC1 and ADC2 are identical models of an ADC. These simplified models do not include protection diodes. The models also neglect the current drawn by the sampling switch and the conversion time on the basis that the microcontroller frame rate is typically much less than the frame rate of the ADC.

Plot Simulation Results from Simscape Logging

Plot the input and output voltages of the anti-aliasing filter. The output voltage closely resembles a sine wave. The 50 Hz component determines the period of 0.2 s and the amplitude of 1 V. The DC component defines the 1.5 V DC offset. The anti-aliasing filter significantly reduces the amplitude of the high-frequency component, which is prominent in the source voltage.

Plot Simulation Results from Spectrum Analyzer

To calculate the power at each frequency in the analog unfiltered signal, use this equation.

$$P_w = \frac{V_{{rms}}^2}{R},$$

where:

  • $P_w$ is the power in watts.

  • $V_{rms}$ is the root-mean-square voltage in volts.

  • $R$ is the resistance of the reference load in ohms.

For the DC component,

$$V_{rms} = V_{DC} ,$$

where $V_{DC}$ is the DC voltage component.

For the AC components,

$$V_{rms} = \frac{V_{peak}}{\sqrt{2}},$$

where $V_{peak}$ is the amplitude of the voltage component.

For a one-ohm reference load, this calculation gives a power of 2.25 W for the DC component, 0.5 W for the 50 Hz component, and 0.125 W for the 1100 Hz component.

To convert power from watts to decibels, use this equation:

$$P_{dBm} = 10\cdot{log_{10}{(1000\cdot{P_w})}},$$

where $P_{dBm}$ is the power in decibels.

This calculation gives a power of 27.0 dBm for the DC component, 33.5 dBm for the 50 Hz component, and 21.0 dBm for the 1100 Hz component. The aim of the filter is to preserve the power at the DC and 50 Hz components and to limit the power at other frequencies.

View the power at different frequencies in the source and output signals in the Spectrum Analyzer block. Both signals contain the expected peaks close to 33.5 dBm at 0 Hz and 27.5 dBm at 50 Hz. The source has an additional peak of 20.1 dBm at the alias frequency of 100 Hz. However, the filter reduces the power at 100 Hz to negligible levels.

See Also

| | | |

Topics

External Websites