ADC process

Thread Starter

Kittu20

Joined Oct 12, 2022
511
Hey everyone!

I've been trying to wrap my head around how Analog-to-Digital Conversion (ADC) works,

So, from what I understand, an ADC takes an analog signal and converts it into a digital signal, right? Let's say we have an audio waveform like a musical note.

I break it down further:

  1. Sampling:
  2. Quantization:
  3. Encoding:

I'd love some clarification an example I've come up with. Can you guys help me out?
 

BobTPH

Joined Jun 5, 2013
11,514
There are various methods, which one are you interested in?

Single slope,
Dual slope,
successive approximation,
sigma delta,
flash

Those are from memory, look it up, there ate probably more.
 

WBahn

Joined Mar 31, 2012
32,823
Well, what example have you come up with? We can't provide any clarification about your example if you don't share it.
 

crutschow

Joined Mar 14, 2008
38,503
I break it down further:

  1. Sampling:
  2. Quantization:
  3. Encoding:
I'd love some clarification
Here are the basics:

The ADC takes many samples of the analog waveform to convert it to a series of digital words (encoded numbers).
According to the Nyquist theorem, the sample rate has to be at least twice the highest frequency of interest in the analog waveform, based on its Fourier components, in order to accurately reconstruct the original analog waveform frequencies with a DAC (Digital to Analog Converter).
(For example, this is usually assumed to be about 20kHz for an audio signal, thus the standard sample rate for audio CDs is 44.1kHz.)

At each sample instant in time, the ADC input determines the analog voltage at that instance and converts it to to a digital number representing that voltage value.
The resolution of the sample is given by the number of bits in the word, which typically varies from 8-bits to over 20-bits (16-bits is used for standard CD audio, which gives a bit rate of 16-bits * 44.1kHz = 705.6k bits/sec from the CD at playback. not including any sync bits).

The stream of digital word numbers coming out of the ADC converter is the end result of the conversion.

The previous posts have listed a number of different ADC conversion techniques.
The best method depends upon several parameters, including needed conversion speed and resolution (often a trade-off between the two), as well as circuit complexity.

That all make sense?
 
Last edited:

Thread Starter

Kittu20

Joined Oct 12, 2022
511
There are various methods, which one are you interested in?
The successive approximation method is a technique used in analog-to-digital converters (ADCs) to convert an analog input voltage into a digital value.
Well, what example have you come up with? We can't provide any clarification about your example if you don't share it.
Example: Let's say we have a 4-bit ADC with an input voltage range of 0V to 5V. We want to convert an analog input voltage of 2.3V
 

crutschow

Joined Mar 14, 2008
38,503
Let's say we have a 4-bit ADC with an input voltage range of 0V to 5V. We want to convert an analog input voltage of 2.3V
If that's a 2.3Vrms voltage centered around 0V, that gives a voltage of ±3.22Vpk, so you have to add a DC bias to center the signal at 2.5V, and attenuate the signal to give an AC voltage of no more than 5Vpp.
 

BobTPH

Joined Jun 5, 2013
11,514
Okay, 0-5V range, 2.3V input, 4 bits.

Here is how successive approximation works:

Start with all bits zero. Starting with the high bit, turn the bit on. Now run the result through a D to A converter, and compare the result. If the input is less than the result, turn the bit off.

So, here is how it goes:

Start: 0000

Turn on high bit: 1000
DAC output: 5 x 8 / 16 = 2.5 V
2.3V is < 2.5V so turn bit off: 0000

Turn on next bit: 0100
DAC output: 5 x 4 / 16 = 1.25V
2.3V is > 1.25V so leave the bit on: 0100

Turn on next bit: 0110
DAC output 5 x 6 / 16 = 1.875
2.3V is > 1.875 so leave the bit on: 0110

Turn on next bit: 0111
DAC output 5 x 7 / 16 = 2.1875V
2.3V is > 2.1875 so leave the bit on: 0111

So your result is 7, which represents 2.1875V, which is as close to 2.3V as you can get with 4 bits.
 

WBahn

Joined Mar 31, 2012
32,823
The successive approximation method is a technique used in analog-to-digital converters (ADCs) to convert an analog input voltage into a digital value.

Example: Let's say we have a 4-bit ADC with an input voltage range of 0V to 5V. We want to convert an analog input voltage of 2.3V
FWIW, 4-bit ADC are almost always flash converters.

There are some devils in the details that need to be considered, most notably where the breakpoints are between successive encodings.

Before we get to your example, let's consider a simpler case.

Let's use a 2-bit case, which has four possible encodings. 0, 1, 2, and 3.

Now let's say that our input voltage range is 0 V to 8 V. If we divide that into four equal ranges, that means that

0 => 0 V to 2 V
1 => 2 V to 4 V
2 => 4 V to 6 V
3 => 6 V to 8 V

But this means that our best estimate of what the input voltage is, given the ADC output, is

0 => 1 V
1 => 3 V
2 => 5 V
3 => 7 V

But this isn't the only way to do it. Sometimes we want the ranges to match up with a comparable DAC and so the mapping gets tweaked in order to make that happen.

For this discussion, let's assume that we divide up the range as shown above.

That means that the span of each code is

Vspan = (Vmax - Vmin) / (2^N)

And the nominal voltage for each code is

Vnom(k) = 0.5·Vspan + k·Vspan = (k+0.5)·Vspan

When doing a conversion, the code that is produced will, ideally, be the one whose nominal value is closes to the input voltage.

We can do this by solving for a nominal k that is not an integer and then rounding it to the nearest integer.

Vin = (k+0.5)·Vspan

k = (Vin/Vspan) - 0.5

k = Vin·(2^N)/(Vmax - Vmin) - 0.5

So, for your example:

k = (2.3 V)·(2^4)/(5 V - 0 V) - 0.5 = 6.86

Anything in the range 6.5 to 7.5 is going to be returned at being 7.

From this, you can see where quantization comes from. The ADC can only report integer values, so there is a range of input voltages that will all get reported as being the same voltage. This is an error that introduces noise into the measurement. Not surprisingly, these are called quantization error and quantization noise, respectively.

Now, one question you might be asking, is what happens if the input voltage exactly straddles two codings (e.g., what if the result had turned out to be exactly 6.5). The answer is that it could return either 6 or 7. In fact, there is a range of values around that dividing line where it could go either way, depending on a number of factors. But, in practice, we seldom care because a voltage that is right in between two code could legitimately be estimated either way.
 
Top