13

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?

user1245
  • 3,955
  • 4
  • 37
  • 87

6 Answers6

24

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

aliasing

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.

filter

source from this presentation

rchard2scout
  • 115
  • 6
user110971
  • 6,067
  • 1
  • 15
  • 23
  • 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? – user1245 May 09 '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. – user110971 May 09 '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. – user1245 May 09 '19 at 13:19
  • @atmnt stop band needs to be after 400 Hz. You need to transition from the pass band to the stop band in the 100-400 range. – user110971 May 09 '19 at 13:29
  • You mean stop band starts at 400Hz or before? I meant that actually. 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 starts at 300Hz? Or the transition should be between 200Hz and 300Hz? Currently 1kHz 6th order anti-aliasing filter is used. – user1245 May 09 '19 at 13:32
  • @atmnt Yes, if you do not care what happens above 200 Hz. You’ll have aliasing there. – user110971 May 09 '19 at 13:37
  • 1
    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. – user1245 May 09 '19 at 13:38
  • 1
    @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. – user110971 May 09 '19 at 13:48
9

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: -

enter image description here

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.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
4

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

Neil_UK
  • 158,152
  • 3
  • 173
  • 387
  • But does stop band have any quantitative definition in dB? – user1245 May 09 '19 at 13:12
  • 1
    @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. – Neil_UK May 09 '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. – user1245 May 09 '19 at 16:47
3

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.

Bimpelrekkie
  • 80,139
  • 2
  • 93
  • 183
  • 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? – user1245 May 09 '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. – user1245 May 09 '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. – Bimpelrekkie May 09 '19 at 13:41
2

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.

Scott Seidman
  • 29,274
  • 4
  • 44
  • 109
0

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.

DrM
  • 111
  • 2