Categories
Analog Electronics Digital Electronics Engineering

When To Use Analog Vs. Digital

Analog. Digital. Continuous. Discrete. Choices abound.

Well, not really.

In reality you will deal with both kinds of signals when working on just about any electronics these days. A simple example is in a switching regulator. These devices are meant to take input power from a wall plug or something providing a relatively constant voltage and then the regulator will ensure that the voltage is always the same when leaving. Internal to the circuit, a “digital” signal (on or off) determines when to let in incoming power go from the input to the output. The “digital” signal translates into an “analog” voltage at the output, hopefully the voltage you programmed.

From there, systems become increasingly complicated, translating real world data to digital format, processing the digital data and spitting it back out again. The guts of the systems have infinite internal combinations and options, but in the end just about every hybrid system looks like this:

ad_system

The remainder of this post will be devoted to explaining situations that are either contained within the above system or situations that benefit from looking nothing like it; some of these situations mandate analog or digital implementation but more importantly, some are best implemented as analog or digital.

To start, what is the definition of analog? We’ll consider it a continuous signal that has infinite bandwidth and complete spectral information. Analog in the context of this site usually refers to the circuitry used to operate on those continuous signals, but we also use the word “analog” interchangeably to describe the signals. Which situations are best suited to using analog components and circuitry?

  1. Continuous filtering — Filtering a signal is necessary when it has frequency components included that you do not want. Some filters are digital and are extremely accurate at removing one signal while retaining others (FIR). However, if you are dealing with a continuous signal and you want to filter ALL possible frequency content (and not be limited by the sampling frequency you used when converting to digital), then you need a continuous analog filter. There are many options available that can also help to push your filtering towards accuracies similar to digital filters but they become increasingly complex (multi-pole active filters). The main advantage to an analog filter here is that it is simple, less expensive (usually) and beyond your roll-off frequency you know that all information is being removed (whereas it might still be hidden in a sampled signal).
  2. Pre-A/D and Post D/A — Hybrid systems require both analog-to-digital converters and digital-to-analog converters to switch between continuous and discrete data. However, the sampling frequency must be at least twice the frequency of the highest frequency component contained within the signal, as explained by Nyquist’s Theorem. In order to ensure that the Nyquist Theorem is fulfilled, you can filter (see above) any signals that are inadvertently included in the original signal so that it does not create noise and artifacts after sampling. Since the signal is not yet digital, you HAVE to filter the signal with an analog filter (convenient, right?). Once you are done operating on a signal digitally and you convert it back to analog, all processing must once again be done with analog components and circuitry (see picture above). I usually think of an iPod after the signal has gone through the DAC. You need to control the gain (volume) and shape the frequency components (tone). Some post DAC activities can be done in the processor, but are often more efficient (read: cheaper) to do in simple analog components after the DAC.
  3. High power — While digital measurement and control is possible for high power systems, having a digital signal that switches between 0 and 400V would not be efficient. In either AC or DC systems, analog components are responsible for transforming and transmitting signals (although there may be digital control of those analog components at some point in the system). The continuous nature of power delivery mandates analog components that are well characterized and durable.
  4. Gain Control/Signal Conditioning — Say you want to measure the amplitude of a 4000 V signal. You decide that you want to use a computer to do so, so you shove your signal into an A/D converter. But wait, where the heck do you find an A/D converter that can convert a 4000V signal? Sorry, they don’t exist (yet). You instead have to condition the signal to fit into a range of 0V to +2.5V, or whatever is the input range of your specific ADC. You can do so with a simple resistive divider (passive, simple) or an inverting amplifier (active, more difficult).
  5. Control systems — While digital control systems are possible and are becoming more and more prevalent, analog systems can be simpler. One of the simplest examples is an inverting op-amp configuration. The load of the op amp is the plant, the op amp is the controller and the resistors are the feedback paths to the summing node. There are some delays in the system, but in general, the signal can handle a wide range of frequencies without complicated circuitry and the system can adjust to however the input changes. In a similar digital system, the feedback resistor would be replaced with an ADC, some kind of computing machine (microcontroller) and a DAC to convert the data back to analog to push into the summing node. The system is dependent upon the technology and speed of the components, whereas the analog system is dependent on resistors and the nature of the load (plant). Digital control systems are becoming more popular as DACs and ADCs become faster and more accurate but as of now, analog control systems remain simpler in some of the more common instances.
  6. Sensors — These devices are meant to help convert real world information that isn’t necessarily electrical, into a format that is recognizable by a computer or embedded system. Oftentimes these are not taking real world (analog) data and directly turning them into digital signals. Instead, the sensor (sometimes known as a transducer) first creates an analog signal that can later be converted. Converse to the high voltage systems, sensors are often very low amplitude and require some signal conditioning to increase the value of the signal to better utilize the full range of an ADC.
  7. Fidelity/Data loss — Some people just love analog stuff, especially when it comes to music. Even though audio systems containing ADCs and DACs are making very good analog equivalents these days, you will have to tear the record players and the tube amps out of the hands of the most die hard audiophiles. So instead of converting back and forth between digital and analog media, they prefer to keep the signal continuous all the way throughout the process. Starting from the air pressure variations emitted from Louis Armstrong’s trumpet that are then captured by a microphone and then amplified and pressed into a record, then touched by a needle and amplified again by a transistor or tube amp to recreate the sound as it is pushed out of your high end speakers. And even though there are processes to mathematically capture all of the data that is present to sample and perfectly recreate the original signal, some people won’t touch the stuff. Since I can’t afford the high end equipment audiophiles claim is necessary, I will sit on the sidelines for this argument. However, I enjoy that there is still so much interest in preserving audio fidelity in analog formats and don’t mind that it keeps analog engineers employed.

I feel a little silly explaining digital advantages because they seem to be flaunted at every opportunity by media and digital chip makers. Still, let’s go over some of the more important places to use digital as opposed to analog.

  1. Computing — Again, I know it sounds silly, but digital has emerged as the better way to compute numbers. How did they compute mathematical sums before the advent of the microchip and digital logic? Why, operational amplifiers of course! That is actually where the name comes from, since there are many different possible operations for incoming signals.  If you have two incoming signals, one at 2 volts and the other at 1 volt, you can: add them (summing amplifier), subtract them (differential amplifier), integrate them or differentiate them. While this can and still does work quite well on a large signal DC basis, using operational amplifiers in the computing machines today would be a bit unruly. Just to start the power usage and the offsets would pose enough problems to make you run out and buy ADCs, DACs and micro-controllers. If you have a big math problem to do, follow that urge. However, if you do have a simple math operation you need to do on two signals and you don’t want the overhead of a digital section, op amps can still do the trick nicely; with their fast reaction and the complete lack of sampling issues you won’t miss those ones and zeros for a second.
  2. Counting — In analog systems, counting can be a difficult task. Instead, using integrators to “sum up” signals is a way to figure out where you might be in a process. Discretizing a signal and then counting how many times it happens can have many uses in control systems, measurement systems and a range of other applications.
  3. Memory — Storing analog signals would be difficult. For even a simple 0-1V signal, you would have to be able to store an infinite number of values. If you have 4 bits to represent the range from 0 to 1 volt, then you instead only need 16 places to store values. In control systems and other places that require memory, the old way to “store” values was to sufficiently delay them and feed them back so as to combine them with a newer signal. Using memory now allows for interesting systems and use of state machines to determine what to calculate or execute next based on current and past input data.
  4. High noise environments — If you are trying to transmit an analog walkie-talkie signal (5Vpp sine wave) in a field that happens to have a white noise generator transmitting (2V) at the same frequency you are using, it is likely that whoever is on the receiving end of that signal will also get a good bit of white noise in their signal (think static). If you instead use a digital signal (varying between 0 and 5V) your friend who has a digital transceiver will be able to discern your transmitted highs (5V) and lows (0V) even if they also have noise added to them. Once the digital data is received and decoded, the original signal (5Vpp sine wave) can be reconstructed on the receiving end.
  5. Signals Transmission – As stated above, there are advantages to transmitting digital signals as opposed to analog. Most notable is the lower power spectral density of the digital signals and that less power is needed to transmit those signals. In current events, we see TV transmission changing from analog to digitla because of the lower power required to transmit the signal and the possibility for multiplexing signals on specific frequencies in order to get more channels transmitted in the allowable spectrum.
  6. Data storage — To use the mp3 example again from above, data is best stored in a digital format (easy there audiophiles, records are alright for some people too). True, some information is lost, but only information above the Nyquist Sampling rate. In audio signals, most people cannot hear above 20 kHz, so there isn’t too much to worry about beyond that (perhaps the harmonics that some people claim to hear and desire in their recorded works).
  7. RF — Digital Signal Processing (or DSP) is one of my favorite digital topics. There are so many cool things you can do with a Radio Frequency (RF) signal once it is sampled and put into a powerful processor. In fact, this process makes your cell phones and Wi-Fi connections possible. FIR filters, CIC filters, baseband shifting and so many other interesting topics make it possible. Hell, maybe some day I’ll start “Chris Gammell’s DSP Life“. Anyway, can’t we do this stuff in analog? Well yes, we can. But with RF, it comes down to precision. With the filters listed above, you can trade off processor time/power for a more precise filter. In analog systems, you instead need more and more precise components and increasingly complex systems to achieve similar results. In DSP there is also reconfigurability, either through logic rework (FPGAs) or coding (in DSP chips), so long term investment usually will favor DSP over analog RF solutions. Finally, there is more efficient use of bandwidth with digital systems, so you can shove more data into the same frequency space. All of these things have helped to push the RF areas towards digital processing.

I think one of the most interesting things when reviewing this list is that it’s possible to implement solutions in myriad ways. Oftentimes cost and tradition (or past work) determine which way a solution will eventually lean (digital or analog). And although I hope to expand upon it in future posts the most interesting thing to me is that analog and digital begin to merge at the extremes: do analog signals really exist if energy is explainable by quantum mechanics? Will digital signal continue to only have two logical states when there is so much data storage capacity available between 0 and 1?

Please comment on the above lists–right or wrong–and let me know a situation or two that you think benefits from analog or digital.

By Chris Gammell

Chris Gammell is an engineer who talks more than most other engineers. He also writes, makes videos and a couple podcasts. While analog electronics happen to be his primary interests, he also dablles in FPGAs and system level design.

12 replies on “When To Use Analog Vs. Digital”

Hey Chris, nice to see you posting again.

Many applications appear “digital” on the surface, but in fact, requires quite a bit of analog circuitry for it to work. Let’s take computing for example. Modern CPU contains a variety of analog circuits — serdes, PLL, DLL, bandgap, regulators — in order to work. Memory, esp. the ubiquitous DRAM, may appears to be a digital device for those using it, but is designed using mainly analog techniques with analog circuitry — sense amplifiers, DLLs. Signal transmission, including RF through high noise environments and including so called “digital transmission”, are in fact all analog transmission with digital baseband processing. The difficulty in all these transmission methods lie not in the DSP baseband section, but in designing linear power amplifiers in the transmitter and low noise-figure amplifiers and mixers in the receiver. Finally, data storage is akin to memory. One may think of storing 1s and 0s on magnetic media (hard drives) is straightforward, but writing and reading the magnetic head is definitely very analog and sending bits into and out of a hard drive requires a high performance serdes which is also very analog.

Almost all high performance “digital” systems necessarily include analog circuitry. When you’re transmitting gigabits per second across a wire or through the air, the problem is no longer just a digital one.

[…] No doubt that people utilize the internet as an instructor for their latest projects. In fact, I’ve tailored some of my own more popular posts (about how op amps work) towards teaching people in certain niche areas. Some of the best sites out there (such as Instructables), helps people to learn about their project or the subject they are studying. The mere fact that they are offering free information (that is assumed to be correct) is a very big draw for the masses. Unfortunately, as far as competition goes, there are some major leaders in terms of “how things work” and the smaller players often fall off the map, hence fewer parties trying to explain a topic like when to use analog versus digital circuits. […]

Hi Chris,
to me one of the great advantages of digital is configuration, parameters and change. The user interface is simpler, just add LCD display and 4 keys. I remember using a induction motor drive that had on a corner of the PCB 16 (SIXTEEN) potentiometers, for configuration of ramp up, ramp down, acceleration, deceleration, max speed etc and these were internal variables, you could "figure out" the real output values (from delta Hz to delta RPM) but it could take a while… (takes in to account slip of the motor and other motor characteristics…).
Also changing algorithms is quite easy, changing from a Bessel to Chebyshev -.5db is not so easy peasy…

Comments are closed.