# Why does increasing the sampling rate make implementing an anti-aliasing filter easier?

From an answer to a question regarding sampling rate and anti-aliasing filter I read the following:

The closer you get to the theoretical minimum sample rate, the more difficult the analog filter become to realize practically.

If I'm not mistaken it says if our sampling rate is close to our required theoretical minimum sample rate, then designing the analog anti-aliasing filter will be more difficult.

I'm sure it makes sense for many but I couldn't figure out what is meant here and why is that so. Could this be explained with an example in a simpler way?

As you decrease the sampling frequency there is less separation between the images in the frequency domain.

source

Remember that the repetition of the spectrum occurs at the sampling frequency. When the images are closer together you need to achieve more attenuation in your anti aliasing filter. The filter must transition from pass band to stop band before the next image occurs.

• Interesting. But the LP filters in green are becoming zero not at 1fs but 1fs-w. Lets say my desired signal BW is 100Hz, and if my sampling rate is 500Hz, does that mean the LP filter stop band must occur maximum at 400Hz? May 9 '19 at 13:09
• @atmnt think what will happen. Your signal occupies the [-100, 100] range. You also have some signal outside of this frequency range that you do not care about. Your first image will appear at 500Hz. To prevent aliasing you need to limit the analog input to the [-400, 400] range. Hence the -400Hz will appear at 100Hz when sampled. May 9 '19 at 13:17
• So is that correct to set the stop band at anything between 100Hz and 400Hz? (Assuming we at 100Hz we have no attenuation) For 100Hz BW signal input. May 9 '19 at 13:19
• Or I could increase the sampling rate instead. But the problem is I need to know that transition region of the filter range to set the correct minimum required sampling rate. I only know it is 3dB at 1kHz and 6th order. May 9 '19 at 13:38
• @atmnt you can work it out. If you use a Butterworth filter, for example, it is 20dB per decade per filter order. Set your stop band attenuation at 60dB or something. But I think this is out of the scope of this question. If you are uncertain about your filter, you should ask another question. May 9 '19 at 13:48

To reconstruct a signal in the digital realm from the analogue realm you need at least two samples in each cycle of the highest frequency present in the analogue signal. For instance, on CDs, they use 44.1 kHz to sample a maximum frequency in the audio band of 20 kHz. They could have used 40 kHz but that is right on the limit and the anti alias filter would be impossible.

With a sample rate of 44.1 kHz, the theoretically highest frequency audio signal that could be digitally captured without aliasing occurring would be 22 kHz. So what would happen if 24 kHz would fed to the 44.1 kHz digital sampling system you might ask.

This would alias into a 20 kHz signal in the digital realm and it could get worse. What if the signal were 30 kHz? This would become 16 kHz in the digital realm.

This is because undersampling creates an aliased output: -

Picture from here.

To prevent this you use a filter that provides adequate attenuation between 20 kHz and 24 kHz. I say 24 kHz because a 24 kHz signal is right on the limit of becoming an aliased real 20 kHz audio signal. So, for those people with excellent hearing up to 20 kHz (not me any more), the anti-alias filter has to provide virtually zero attenuation at 20 kHz and maybe up to 80 dB (or more) attenuation at 24 kHz.

That is a fairly high order filter and most engineers dealing with systems like this would prefer a ratio of more like 3:1 for sampling rate to highest analogue frequency.

Your antialias filter has three bands

1) Passband, from DC up to Fwanted
2) Stopband, from Fsample-Fwanted up to infinity
3) Transition band, from Fwanted to Fsample-Fwanted

The cost of a filter (number of stages, component Q, number of multipliers) is roughly proportional to the reciprocal of the transition band, and increases with the depth in dB of the stopband.

The higher Fsample, the wider the transition band, and the cheaper the filter

• But does stop band have any quantitative definition in dB? May 9 '19 at 13:12
• @atmnt The stopband is whatever you want it to be. Some folks are happy with -40dB (you won't see the aliasing on an oscilloscope), other folks need -100dB (for high performance measuring instruments). A deeper stopband also costs, I'll update my answer to include that. May 9 '19 at 15:20
• Your answers are very informative. Just one more question by using an example. When you say Fwanted do you mean 3dB cut off freq.? If for instance the desired bandwidth of a vibration from a force transfucer is 200Hz would our Fwanted be chosen 200Hz or a bit more? Im asking because when we say Fwanted do we mean flat and no attenuation or 3dB freq. May 9 '19 at 16:47

Suppose your sample rate is $$\f_s\$$

Then, according to Nyquist I can sample signals with a frequency content up to $$\f_s/2\$$ and use the sampled data to accurately reconstruct my signal.

What happens if my signal doesn't "stop" at $$\f_s/2\$$, then these signals above $$\f_s/2\$$ will disturb the sampling and my reconstructed signal will not be the same anymore. This effect is called aliasing.

So these signals above $$\f_s/2\$$ need to be filtered out using an anti-aliasing filter.

However we do not want that filter to affect the signals $$\f_s/2\$$!

So the filter ideally needs to:

Do nothing when $$\f < f_s/2\$$

but

block everything when $$\f > f_s/2\$$

That's impossible to make! So there needs to be a compromise.

When the highest frequency in your signal is close to $$\f_s/2\$$ then you would need an impossible to make filter to not let it affect your signal frequencies close to $$\f_s/2\$$

Things become much easier if we either:

Limit the signal frequencies to much smaller frequencies than $$\f_s/2\$$

or

we increase the sampling frequency so that $$\f_s/2\$$ ends up at a much higher frequency.

Then we "pull apart" the highest signal frequency and the $$\f_s/2\$$ frequency.

That then "creates room" for the anti-aliasing filter as the frequency at which the filter should not do anything (highest signal frequency) and the frequency at which everything should be blocked ($$\f_s/2\$$) will be further apart.

• In practice does stop band have any quantitative definition in dB? One must decide it I guess when designing but what is the quantitative target dB? Any idea? May 9 '19 at 13:24
• As another example, I have some force transducers are sampled with 500Hz and the interest of BW is 200Hz. So do I need an LP anti-aliasing filter where its stop band is at 300Hz? Currently 1kHz 6th order anti-aliasing filter is used. May 9 '19 at 13:31
• There is no clear answer. If your filter attenuates more (higher order) then obviously aliasing becomes less of a problem. But it may affect your signal more. It is a compromise that has to be found for every application individually. It also depends on your signal, if there are no contents which can create aliases then no filter is needed. 500 Hz is extremely low and relatively close to your 200 Hz BW. As even 1 Msps ADCs are cheap these days an alternative could be a very simple RC filter (1st order) but sample at 1 MHz. If that's too much data then do averaging. May 9 '19 at 13:41

Let's say your band of interest is from DC to 100Hz, and your signal has Band-limited white noise to 10kHz. Now, let's say you decide to sample at 2kHz. You can build a nice low-pole count filter with a 20dB/decade attenuation, and attenuate the noise to minimize aliasing

Now, let's say you want to sample at 210Hz. You need to build a high-order filter in order to get a sufficient attenuation. Such filters are harder and more expensive to design and construct. If you manage to do it right, you get a signal with substantial phase distortion in the pass band.

For the analog filter, you have to consider the performance of the filter in the range of the highest frequency of interest. Often this means that you need to set the "fc" for the analog filter a bit higher than the highest frequency of interest (and/or use a sharper filter).

To avoid aliasing, you have to sample at a frequency that is at least twice that of the highest component that will come through your filter at some maximum level at which you can tolerate pollution by the aliased signal. That means the sampling rate is at least twice fc, and often it needs to be a bit higher.

So, now, working backwards, a higher sampling rate, means you can have a higher fc, and that means you can more easily have a flat response up to some frequency of interest less than fc.

But. as you probably know, noise increases with bandwidth. So, for a low noise application, you may need to set the bandwidth of the filter conservatively.