Electronic – Advantages of filtering signals using analog or digital methods

active-filteranalogdigital filterfilter

In my understanding, it seems that there are, broadly speaking, two primary ways in which signals are filtered for analysis by computers, which are software-side filters and hardware-side filters (generally of the RC op-amp variety). What though is the advantage of using the RC op-amp setup though for, say, low and high pass filters when there is always tradeoff between the amount of attenuation and integrity of the signal when using a hardware filter like an RC op-amp setup. Whereas a digital, code-applied filter would function almost exactly like the brick-wall that is the filter ideal for low and high pass filters. But that seems a little too cut-and-dry to me, is there some benefit to using one over the other (or both together)? Maybe for notch filters I could see analog active filters working better precisely for their imperfect attenuation, but that's all I can think of off the top of my head.

Best Answer

Two parts to this answer. The first is that there is no such thing as a digital anti-aliasing filter. Before the analog signal can make it into a computational device for processing, one must guarantee that Nyquist criteria are met, or at least that violations will be small. This means that in many cases, analog filtering of some level is required.

After that, assuming you can get your signal into a computational device, filtering can certainly be a digital process, and the decision of whether to go analog or digital will depend upon numerous factors. For example, how much computational power do you need to accomplish what you're trying to accomplish? Does it mean stepping up to a bigger badder microcontroller, or even a DSP? What will this cost? Is there expertise in place to make it happen? How long will development take? Are you starting from a blank slate, or do you need to shoehorn the filter into a big bag of existing code, meaning there may be project management issues. Are the firmware folks the same as the hardware folks, or is it an entirely different team?

Indeed, if you've already prefiltered for sampling, will a modest analog addition to your circuit take care of your issues? Will this cost less than doing it digitally? Is there room on your board to do it? Do you have any spare opamps already on your board?

Some folks might bump into regulatory issues. For example, if its a medical device you're talking about, software and hardware are almost considered to be separate devices, and how much money/time you'll spend dealing with validation/verification may well depend on whether you use hardware filtering or digital filtering.

Sometimes you can run into some issues with sampling rate and how much room you have in the frequency domain to do your filtering. For example, if you sample at 200 Hz, and need a clean filter at 98 Hz, this will be difficult to do digitally. In fact, you may need to oversample or upsample, filter, then decimate. Such issues don't appear in the analog domain (though steep filters can still be costly).

Also, filtering can slow down your hardware. You may need to use bigger words than your ADC dictates to make sure you don't overflow. You may be adding a bunch of slow divides. If you need speed, and your digital platform is marginal, that might push you toward analog.