Electronic – Anti-Aliasing filter design

aliasingfilterpicsampling

I appreciate that different applications have different criteria, but could someone give a ball park figure of how much attenuation is needed for an anti aliasing filter at the Nyquist frequency to prevent aliasing?

For example I'm building a filter for the input of my PIC which samples at 10KHz and therefore the Nyquist frequency is 5KHz. I'm only interested at parts of the signal below 3KHz, so I have some leeway in my design as to whether I choose a second order/third order low pass filter, but I don't know which to design because I don't know how much attenuation at 5KHz would be sufficient?

Best Answer

If you are interested only in signals in the range DC to 3kHz, then only signals above 7kHz will alias onto those.

This means that you need a filter with ...

a passband to 3kHz
a transition band from 3kHz to 7kHz
a stopband from 7kHz upwards

Note this doesn't define the 5kHz attenuation, and doesn't need to.

The stopband must have enough attenuation to protect your signals. If you want 0.1% fidelity for your lowpass signals, you need 60dB attenuation in your stopband. You will usually find it more practical to design an elliptic filter than a classical Butterworth or Cheby to get adequate stopband attenuation.

Now comes some subtlety, follow me carefully.

What does 'if you are only interested in signals in the DC to 3kHz' really mean?

If you are bandpass analysing signals up to 3kHz, for instance estimating the power in the bandwidth 2.5kHz to 2.7kHz, using a good digital filter to isolate the band, or an FFT which is equivalent, then having a transition band from 3kHz to 7kHz is just fine.

Although it allows signals in the 5k to 7k band to alias down to below 5kHz, they are still above 3kHz, and you're going to ignore/reject those signals anyway.

If however you are plotting the samples on a scope trace, then you may have inadvertent energy above 3kHz that is still valid. For instance if you have a 1.1kHz square wave, you will have harmonics at 3.3kHz, 5.5kHz, 7.7kHz.

Now, the crucial point is that the 3.3kHz harmonic will be coherent with the fundamental, and if you plot it, it will look OK, even if its amplitude has been suppressed a little by the filter. However, the 5.5kHz harmonic will be aliased to 4.5kHz, and will be incoherent with the fundamental because its frequency has been reflected through Nyquist, and will breathe in and out as its phase changes, and will generally look wrong.

What this means is, if you are going to end up making use of energy in the 3kHz to 5kHz band anyway (even though you've said in the OP that you're not), then your transition band should only go to 5kHz, not 7kHz, so that no aliasing at all is permitted into the DC to 5kHz band.

Whether your filter has a stopband from 7kHz, or from 5kHz, depends crucially on what you intend to do with your signals. Needless to say, it's much harder to make a filter with a 3k-5k transition band, than a 3k-7k transition band.