Digital and analog filters both take out unwanted noise or signal components, but filters work differently in the analog and digital domains. Analog filters will remove everything above or below a chosen cutoff frequency, whereas digital filters can be more precisely programmed. Analog filters that remove signals above a certain frequency are called low pass filters because they let low frequency signals pass through the filter while blocking everything above the cutoff frequency. An analog filter that removes all signals below a certain frequency is a high pass filter, because it lets pass everything higher than the cutoff frequency.
Analog filters are circuits made of analog components such as resistors, capacitors, inductors, and op amps. Digital filters are often embedded in a chip that operates on digital signals, such as an MCU, SoC, processor, or DSP. Analog filters are fairly simple but increase in complexity if you desire a more precise roll-off; that is, making the filtered result more precisely “step-like” at roll-off requires successively more components.
Digital filters can be more precise in filtering, but the signal must be digital. Placing a digital filter in an analog signal chain would require the analog signal to be converted to a digital signal before the digital filtering could be applied and, with any conversion, there are trade-offs in signal integrity. Digital filters work by oversampling and averaging, and are programmable. But it is wise to apply an analog filter prior to signal conversion so that all unwanted frequencies above or below where the desired signal is reasonably expected to operate are removed first. The conversion process and choosing an analog-to-digital signal converter (ADC) is in itself a careful process that involves choosing a sampling rate that will avoid aliasing during conversion. This is because an aliased signal is indiscernible to a digital filter and therefore the aliased portions of the signal would become a permanent part of the digital signal.
Therefore, choosing an ADC is in itself a task that requires careful attention to Nyquist sampling rates and frequencies. Therefore, although digital filters are more precise and programmable, getting a real world analog signal to an accurate digital representation is half the battle and requires specific knowledge of the expected real-world signal so that specifications for conversion can be defined.
There are shortcuts to the digital domain, however. If you are measuring temperature, for instance, it may be easier to select a digital temperature sensor that does the conversion for you. It’s no surprise, then, that the majority of temperature sensors now available appear to be digital, and thus ready-to-use with an MCU, DSP, SoC, processor or another device that operates in the digital domain.