Advertisement

Blog

Analog or Digital Filters: What Works Best for Which Application?

This is the second part of my thoughts on the analog or digital filters issue raised by Steve Taranovich. Whether or not it's the last part will depend on the response of the legions of Planet Analog readers out there.

There are many everyday things that can be “done” using either analog or digital methods. In imaging and audio, digital has long since overwhelmed analog, primarily because the means of distribution of both visual and audio content are overwhelmingly digital, even if analog means of production are still available.

Even if the dominant technology paradigm compels us to choose a digital solution, we all sense that in principle, we could take our photographs with a film camera, and digitize (and probably compress) the resulting images if needed. We could record our interviews or concerts on an old Nagra reel-to-reel or a cassette deck, and digitize (and probably compress) them. The methods remain interchangeable, to a limited extent — one is, to some degree, a substitute for another.

I've wasted precious blog word count on this leaden analogy for a reason: In very many cases, digital and analog filters are NOT substitutes for each other. The very question “should I use a digital filter or an analog filter” is misleading. Your system design should, if it is detailed enough, already contain a satisfactory answer to that question.

The simple filters we're thinking of here take one input signal and deliver one output signal. The archetypal “analog filter” takes an analog input and gives an analog output. Conventionally these signals are both voltages and the signal is just the voltage as a function of time. The “digital filter” has signals that are represented by arrays of numbers, the array index implying successive instants in time that are generally uniformly spaced by some sampling interval.

Domain-crossing filters are perfectly feasible. You might require an analog input to give a digital output, or vice versa. Note that these combinations can be achieved in other ways than the totally obvious approach of following an analog filter with an ADC, and so on. A properly condensed system block diagram should be agnostic to the actual format or domain of its signals except at the boundaries.

But this is a counsel of perfection, in terms of system design philosophy. The very presence of a converter, say a sampling ADC, may require an analog filter in front of it in order to convert correctly the expected input signal with an acceptably low level of aliasing.

This should be one example where it's abundantly clear that the question “do I use an analog or a digital filter?” is a dumb one. It's simple reduction ad absurdum. Replacing an analog antialiasing filter with a digital filter requires that you first convert the filter's input analog signal to digital, before sending it off to your chosen computation shop.

But if you have the wherewithal to convert the analog input signal to digital — without the infinite recursion of needing another analog filter — why, you've already solved the problem, and you don't need the digital filter at all. I could come up with some other examples, but I'd only be insulting your intelligence more than I already have.

I'm sure I'll hear the sound of the “oversimplification klaxon” on account of this explanation. You may say that in mixed domain systems, there may be a genuine choice between doing the filtering in domain A and then converting to domain B, or converting the signal directly from domain A to domain B and then doing the filtering in domain B.

This is perfectly plausible, but here's the overarching point: This can only be true if the filtering is not required in order to manage or optimize one of these domain conversion steps. And a very high percentage of filter designs are on the board just to do that.

There's really only a choice between analog and digital filtering when you have a choice between analog and digital approaches to your entire system design. Under those circumstances, you might expect a life-long analog guy like me to plump for the analog approach. Well, perhaps when I started out, in the late 70s, digital filtering might have been an expensive luxury in comparison to conventional electronic components.

I must say now though that the consistency of digital filtering, combined with its great compatibility with low voltage submicron CMOS and highly integrated SoCs, means that this lover of analog spends much more time these days designing and dropping digital filters into architecture diagrams, than analog ones.

I still creep into the “analog gym” from time to time to work out on an old-style piece of analog apparatus. I'm still best friends with several classical arrangements of resistors, capacitors, and op-amps. Ahh, those were the days. Mail me your analog filter design requests! But when I want my customer to build a million of something for a BOM of pennies, tasting the glue at the edge of the performance envelope? Digital, mate.

Related posts:

9 comments on “Analog or Digital Filters: What Works Best for Which Application?

  1. Scott Elder
    July 26, 2013

    Hi Kendall – As I was reading I thought you were heading down the path that analog filtering is equally as important as digital.  But right at the end you came through!!!  From where I sit, it sure seems like the future is (a) gain the signal up enough so the ADC doesn't set the noise floor, (b) ADC, and (c) do everything thereafter in the digital domain–filtering and all.

    And with a delta-sigma ADC at a high oversampling rate, the anti-alias is usually very simple.

    How do you see the future with regards to analog signal processing?  Are you still seeing lots of discrete analog filtering?

  2. kendallcp
    July 26, 2013

    >> Are you still seeing lots of discrete analog filtering?

    Only when I look back at my old work.  Mostly I do analog filter design for fun, not because it's the right thing for my customers.  Sadly  )-8b

    Though I am working more with some switched-cap implementations now, for some future Cypress parts.  I used to look down my nose at them, since their performance was always orders of magnitude short of the best continuous time active filters.  But when cutoff frequency programmability, low external component count and response conformity are much more critical than SNR (many industrial comms applications fall into this category) they are actually quite exciting.  So I'm learning some new stuff!

  3. SunitaT
    July 29, 2013

    The first benefit is speed: digital is slow; analog is fast. A pc can only filter data at about 10,000 samples per second, using FFT convolution. Even simple op amps can operate at 100 kHz to 1 MHz, 10 to 100 times as fast as the digital system! It is easy to scheme an op amp circuit to concurrently handle frequencies between 0.01 Hz and 100 kHz. When this is tried with a digital system, the computer becomes swamped with data. For instance, sampling at 200 kHz, it takes 20 million points to capture one complete cycle at 0.01 Hz. The frequency response of digital filters is always plotted on a linear frequency scale, while analog filters are usually displayed with a logarithmic frequency. This is because digital filters need a linear scale to display their exceptional filter performance, while analog filters require the logarithmic scale to display their huge dynamic range.

  4. Dirceu
    July 29, 2013

    “…The very presence of a converter, say a sampling ADC, may require an analog filter in front of it in order to convert correctly the expected input signal with an acceptably low level of aliasing…”

       Even if the ultimate goal is to implement a digital filter , is required from the designer a wide expertise on the analog field . For example, in the conditioning circuit which precedes an analog pre- filter on an ECG. An integrator could feed back a voltage on INA Vref pin, maintaining a constant DC level at the output, regardless of the change in skin contact resistance. This allows you to use the entire range of ADC and therefore use the maximum resolution of the digitized signal. The final digital filter not will suffer from poor resolution.

    That can not be performed after the signal has been acquired (on digital domain).

  5. kendallcp
    July 29, 2013

    >> This allows you to use the entire range of ADC

    Sometimes yes, sometimes no.  If the input-referred SNR of the ADC subsystem improves when you increase its sensitivity, then getting rid of the unwanted low frequency content of such a signal in the analog domain is worthwhile.  If not, then the system SNR is not being limited by the digitization process, and digital 'gain' (i.e. scaling) is just as good as analog gain.

    Many low noise low speed high resolution ADCs use a delta-sigma architecture in which the output resolution is entirely set by truncation of the output word.  If you don't do the truncation but just process the full width of the decimation filter, digital scaling works just fine.  Once you get to the point where the input stage of the first amplifier in the signal chain dominates the system noise floor (compared to all the other amplifiers and the converter's noise-like errors), there's just no point adding more analog gain.

  6. kendallcp
    July 29, 2013

    >>  A pc can only filter data at about 10,000 samples per second, using FFT convolution

    Well, don't use [that implementation of] FFT convolution!  An associate of mine can implement hundreds of high precision filter biquads running at audio sample rates on a modern PC.  CPU's in PCs are VERY fast at double precision and even floating point.

    >> Even simple op amps can operate at 100 kHz to 1 MHz

    'Operate' is such a relative word.  If you actually want accurate and stable filter responses, and low levels of signal non-linearity, steer well away from the unity gain frequency of a conventional op-amp.  I'd be wary of seeing signals over 10 kHz pushed through an op-amp with an advertised 1 MHz GBW.

    >>  the computer becomes swamped with data

    Whether or not this is true of any given computer and sample rate, it would be the same whether the filter was executed before or after the ADC.

    >>  The frequency response of digital filters is always plotted […]

    I need to burst your bubble there.  We can use any scales we like, both for gain and frequency.  I'm really not sure where you picked up such an inaccurate impression.

  7. studleylee
    August 7, 2013

    This is an interesting article to me particularly in that I'm toying with making a hearing aid for my sistor.She had a virus weaken some nerve response in her one hear so it sounds muffled mostly now.

    She's already been to the specialist and been recommended several, one even a bone cunduction one that reguides an implant. Dang!

    I'd thought I'd try my hand at it. I bought some CODEC eval boards from TI and MAXIM. but on the other hand when I make guitar effects, I also have a trove of tiny state variable( parametric ) eq circuits that I can implement with several sot23-6, dual tsot, msop, opamps, tiny digipots and a sot 3,6,8pin micro from Mchp, atmel etc. this could all fit behine the ear. the micro can got to sleep when not updating the pots and doing NVupdates. For the CODEC design, some of them offer access to am internal tiny dsp and biquads can be implemented. The MAXIM one I ordered MAX9867EVKIT+ looks like is doesn't, I pulled the trigger too fast on that one, but others they have might. Also TI. There may be a need for an EEPROM and a micro to babysit/config. And would swithing noises be more evident? I have a DIE bonder I've been dieing(pun) to drag out and get going to dead but these tiny packages if needed, but I have the stereo microscopes, metcal and all to do tiny work eitherway.

    I think it's about time for a serious open-source hearing aid project. Thaks for any thoughts or suggestions. -Lee Studley

     

     

  8. catraeus
    August 7, 2013

    Zverev. Chebychev, Cauer, Butterworth, Inverse Chebychev, Image Parameter, Thompson, Gauss, Bessel, Legendre … These are not mystical beasts.  They solved approximation problems using the components available to implement the rational polynomial solutions in s of differential equations of circuit components.

    Harris, Gold, Rabiner, Rade, Remez, Hanning, Hann, Blackman, Hamming, Kaiser, Parzen are no oracles either.  They just solve approximation problems using the cosine equations that derive from periodic signals in t to periodic signals in s.

    Are we at a stable operating point between analog and digital … I don't think so.  We still make Cauer filters in chunks of copper at high GHz and I believe that these will become digitized eventually.  Analog SOC might make some analog implementations more attractive … Hmmmm … compile and debug a Butterworth filter in Eclipse and download to the chip over JTAG.  But those would be digital coefficients, how does that fit into the digital/analog divide?

    The right choice is only apparent after running the numbers, Chauvinism is a really bad thing in Engineering.  It would be ludicrous to make a 7th order elliptical filter as an antialias to an ADC.  It would be insane to use an MSP430 to take out the spikes in your 60 Hz power line monitor.

     

    @studleylee – Please please be careful with your sister's precious ears.  I work in medical devices … First! Do no harm.

  9. Brad_Albing
    August 11, 2013

    @studleylee – keep us posted on how this project develops.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.