DSPRelated.com
Forums

How do you interpret ADC result?

Started by sanaysan November 7, 2010
Hello,

I search for any professional solution/opinion on the following task:

Initial Conditions:
Consider, an ideal positive (input from 0 to Uref) 8-bit (output form 0 to
255, inclusive) A/D converter produced a sample with a value of [x]
(0<=x<=255). The reference applied to the ADC is of [+Uref].

Question:
That intepretation method (or formulae) do you use (or recommend) to
reconstruct (in fact, guess) an original signal level (U) which the
produced sample value (x) is corresponding to?

I'm asking about this, because i saw no such an information in DSP related
books.

Beforehand thanks,
Alex



On 11/7/2010 6:11 AM, sanaysan wrote:
> Hello, > > I search for any professional solution/opinion on the following task: > > Initial Conditions: > Consider, an ideal positive (input from 0 to Uref) 8-bit (output form 0 to > 255, inclusive) A/D converter produced a sample with a value of [x] > (0<=x<=255). The reference applied to the ADC is of [+Uref]. > > Question: > That intepretation method (or formulae) do you use (or recommend) to > reconstruct (in fact, guess) an original signal level (U) which the > produced sample value (x) is corresponding to? > > I'm asking about this, because i saw no such an information in DSP related > books. > > Beforehand thanks, > Alex > > >
One way or another, you need to calibrate the A/D conversion process. That is, what voltage input yields what numeric code output? Maybe you can do that by reviewing the A/D converter spec sheet. And, certainly, you can do that by inputting various stable voltages (i.e. dc) and observing the output codes. Once calibrated, you will be able to relate an actual output code to an input voltage. Neglecting noise and other anomalous effects of course. It seems a bit strange that you use the term "Uref". And you have already stated: "(input from 0 to Uref) 8-bit (output form 0 to 255" So, it rather sounds like an input of voltage valued "Uref" will yield a 255 output. Assuming no compression, i.e. linear input/output relationship, then a particular code output would relate to a voltage input like this: voltage in = Uref * code out / 255 and depending on the A/D specs, somehting like +/- 0.5/255 representing the quantization relative to the analog input. So, if that's correct, then code out = 255 means an input of Uref. If that's not correct, then there is some other input voltage Vmax that *just* yields 255 output (anything larger than 255.5*Vmax/255 more or less may still yield 255 output and would be "saturated"). Then: voltage in = Vmax * code out / 255. This is just a more general formulation that that using Uref and if Vmax=Uref then they both work the same. Let's say that Vmax = 1.000 volts. Then each bit represents 1.000/255 = 3.9216mv And, any output xxx decimal would represent an input voltage of xxx / 255 * 3.9216 * 10^-3 +/- 3.9216/2. I've not run into any A/D's that threshold so that it would be xxx/255 * Vmax/255 -0, +Vmax/255 or xxx/255 * Vmax/255 -Vmax/255, +0 But such devices may exist..... Fred
On Nov 7, 9:11&#4294967295;am, "sanaysan" <sanaysan@n_o_s_p_a_m.gmail.com> wrote:
> Hello, > > I search for any professional solution/opinion on the following task: > > Initial Conditions: > Consider, an ideal positive (input from 0 to Uref) 8-bit (output form 0 to > 255, inclusive) A/D converter produced a sample with a value of [x] > (0<=x<=255). The reference applied to the ADC is of [+Uref]. > > Question: > That intepretation method (or formulae) do you use (or recommend) to > reconstruct (in fact, guess) an original signal level (U) which the > produced sample value (x) is corresponding to? > > I'm asking about this, because i saw no such an information in DSP related > books. > > Beforehand thanks, > Alex
Are you making this too hard? Is this a homework question or a take home test? This is a simple linear relationship between the input voltage and the numeric representation 'x'. The data sheet for your ADC will give you the details, but I expect you don't have a data sheet for an ADC on a test. The instructor gave you all the info you need. Rick
>On Nov 7, 9:11=A0am, "sanaysan" <sanaysan@n_o_s_p_a_m.gmail.com> wrote: >> Hello, >> >> I search for any professional solution/opinion on the following task: >> >> Initial Conditions: >> Consider, an ideal positive (input from 0 to Uref) 8-bit (output form 0
t=
>o >> 255, inclusive) A/D converter produced a sample with a value of [x] >> (0<=3Dx<=3D255). The reference applied to the ADC is of [+Uref]. >> >> Question: >> That intepretation method (or formulae) do you use (or recommend) to >> reconstruct (in fact, guess) an original signal level (U) which the >> produced sample value (x) is corresponding to? >> >> I'm asking about this, because i saw no such an information in DSP
relate=
>d >> books. >> >> Beforehand thanks, >> Alex > >Are you making this too hard? Is this a homework question or a take >home test? > >This is a simple linear relationship between the input voltage and the >numeric representation 'x'. The data sheet for your ADC will give you >the details, but I expect you don't have a data sheet for an ADC on a >test. The instructor gave you all the info you need. > >Rick >
Could it be the linear relationship (Vref+ - Vref-)/2^n = (5-0)/256 [Volts/Step] Maybe that's enough of a hint to get you in the right direction.
Hi, Fred,

The method you wrote:

>voltage in = Uref * code out / 255
or, in common form, voltage in = Uref * [X] / [Xmax] where 0<=[X]<=Xmax Xmax=2^n-1 (n is ADC bit number) is erroneous. It can be proven very simple: Consider the ADC with Uref=1, n=2, and normal (not shifted) transfer function. A code of 0 ([X]=0) will correspond with an interval (of input voltages) from 0 to 0.25, and you interpret it as 0/3=0.0, etc... The all 4 cases can be represented as the following table: Input voltage Intepretation Comment interval result [0.00; 0.25) 0/3=0.00 in interval, error -0.00/+0.25 [0.25; 0.50) 1/3=0.33 in interval, error -0.08/+0.17 [0.50; 0.75) 2/3=0.67 in interval, error -0.17/+0.08 [0.75; 1.00] 3/3=1.00 in interval, error -0.25/+0.00 LSB=0.25, no shift maximum error +0.25/-0.25 -LSB/+LSB But any computational algotith and the DSP theory awaits from you accuracy of LSB/2 !!! Is not it? Then, your expression for the error with n=8
> +/- 0.5/255
is not rigth. Now, look at the shifted transfer function case: Input voltage Intepretation Comment interval result [0.000; 0.125) 0/3=0.000 in interval [0.125; 0.375) 1/3=0.333 in interval [0.375; 0.625) 2/3=0.667 (!!!) OUT OF INTERVAL (!!!) [0.625; 1.000] 3/3=1.000 in interval LSB=0.25, shift=-LSB/2=-0.125 One point is out of interval. (It is for any n >=2.) Did you think about this earlier? Also, you can state that the interpetation result is the same in both cases: it is totally alienated from the ADC matter (i.e. transfer function). I know that such a solution is very popular today, but it is comletely naked. About calibration. I described that the ADC is ideal. Therefore, it is not necessary to calibrate it. (Calibration is another process, but during it, you also must take into account that an ADC result, or code, corresponds with an interval of input volatges inssted of a single point.) Thanks a lot for your help and explanation. Alex
Well, Rick,

look at any ADC datasheet, but make it carefully.  That do you see?

Do you see the ADC transfer function?  If yes, you can state that each code
corresponds with an interval (definable by two points: lower and higher
limits) of input levels.

For an ideal ADC, there is one and only one code that corresponds to the
input level being converted.  But, in backward direction, there are
unlimited number of input levels that can corespond to a single code.

It is simple to solve the problem in forward direction: the transfer
function provides only one solution.  But, how to solve the problem
effectively and right in backward direction?  This is what i asked in this
post. 

This was not a homework, nor a test.  Algthouth, it could be a test.  How
do you think, Rick, did you pass it?

Alex

P.S.  Datasheet for an ideal ADC -- very funny :-)


> >Are you making this too hard? Is this a homework question or a take >home test? > >This is a simple linear relationship between the input voltage and the >numeric representation 'x'. The data sheet for your ADC will give you >the details, but I expect you don't have a data sheet for an ADC on a >test. The instructor gave you all the info you need. > >Rick >
So what you're asking is: how do you figure out to infinite resolution 
the input to a finite resolution system?

Be sure to let us all know when you've figured it out.

On 11/9/2010 4:14 AM, sanaysan wrote:
> Well, Rick, > > look at any ADC datasheet, but make it carefully. That do you see? > > Do you see the ADC transfer function? If yes, you can state that each code > corresponds with an interval (definable by two points: lower and higher > limits) of input levels. > > For an ideal ADC, there is one and only one code that corresponds to the > input level being converted. But, in backward direction, there are > unlimited number of input levels that can corespond to a single code. > > It is simple to solve the problem in forward direction: the transfer > function provides only one solution. But, how to solve the problem > effectively and right in backward direction? This is what i asked in this > post. > > This was not a homework, nor a test. Algthouth, it could be a test. How > do you think, Rick, did you pass it? > > Alex > > P.S. Datasheet for an ideal ADC -- very funny :-) > > >> >> Are you making this too hard? Is this a homework question or a take >> home test? >> >> This is a simple linear relationship between the input voltage and the >> numeric representation 'x'. The data sheet for your ADC will give you >> the details, but I expect you don't have a data sheet for an ADC on a >> test. The instructor gave you all the info you need. >> >> Rick >>
-- Rob Gaddi, Highland Technology Email address is currently out of order
On 11/9/2010 4:14 AM, sanaysan wrote:
> Well, Rick, > > look at any ADC datasheet, but make it carefully. That do you see? > > Do you see the ADC transfer function? If yes, you can state that each code > corresponds with an interval (definable by two points: lower and higher > limits) of input levels. > > For an ideal ADC, there is one and only one code that corresponds to the > input level being converted. But, in backward direction, there are > unlimited number of input levels that can corespond to a single code. > > It is simple to solve the problem in forward direction: the transfer > function provides only one solution. But, how to solve the problem > effectively and right in backward direction? This is what i asked in this > post. > > This was not a homework, nor a test. Algthouth, it could be a test. How > do you think, Rick, did you pass it? > > Alex > > P.S. Datasheet for an ideal ADC -- very funny :-) > > >> >> Are you making this too hard? Is this a homework question or a take >> home test? >> >> This is a simple linear relationship between the input voltage and the >> numeric representation 'x'. The data sheet for your ADC will give you >> the details, but I expect you don't have a data sheet for an ADC on a >> test. The instructor gave you all the info you need. >> >> Rick >>
So what you're asking is: how do you determine with infinite resolution the input to a finite resolution system? Be sure to let us know when you've figured it out. -- Rob Gaddi, Highland Technology Email address is currently out of order
On 11/9/2010 3:37 AM, sanaysan wrote:
> Hi, Fred, > > The method you wrote: > >> voltage in = Uref * code out / 255 > > or, in common form, > > voltage in = Uref * [X] / [Xmax] where 0<=[X]<=Xmax Xmax=2^n-1 > (n is ADC bit number) > > is erroneous. It can be proven very simple: > > Consider the ADC with Uref=1, n=2, and normal (not shifted) transfer > function. A code of 0 ([X]=0) will correspond with an interval (of input > voltages) from 0 to 0.25, and you interpret it as 0/3=0.0, etc... The all 4 > cases can be represented as the following table: > > Input voltage Intepretation Comment > interval result > [0.00; 0.25) 0/3=0.00 in interval, error -0.00/+0.25 > [0.25; 0.50) 1/3=0.33 in interval, error -0.08/+0.17 > [0.50; 0.75) 2/3=0.67 in interval, error -0.17/+0.08 > [0.75; 1.00] 3/3=1.00 in interval, error -0.25/+0.00 > > LSB=0.25, no shift maximum error +0.25/-0.25 > -LSB/+LSB > > But any computational algotith and the DSP theory awaits from you accuracy > of LSB/2 !!! Is not it? > > Then, your expression for the error with n=8 >> +/- 0.5/255 > is not rigth. > > Now, look at the shifted transfer function case: > > Input voltage Intepretation Comment > interval result > [0.000; 0.125) 0/3=0.000 in interval > [0.125; 0.375) 1/3=0.333 in interval > [0.375; 0.625) 2/3=0.667 (!!!) OUT OF INTERVAL (!!!) > [0.625; 1.000] 3/3=1.000 in interval > > LSB=0.25, shift=-LSB/2=-0.125 > > One point is out of interval. (It is for any n>=2.) > Did you think about this earlier? > > Also, you can state that the interpetation result is the same in both > cases: it is totally alienated from the ADC matter (i.e. transfer > function). > > I know that such a solution is very popular today, but it is comletely > naked. > > About calibration. I described that the ADC is ideal. Therefore, it is > not necessary to calibrate it. (Calibration is another process, but during > it, you also must take into account that an ADC result, or code, > corresponds with an interval of input volatges inssted of a single point.) > > Thanks a lot for your help and explanation. > > Alex
By "calibration" I meant that you had to relate the input voltages to the output codes. Being "ideal" doesn't relieve that need. But, it may be simple indeed! Fred
On Nov 9, 12:37&#4294967295;pm, "sanaysan" <sanaysan@n_o_s_p_a_m.gmail.com> wrote:

> About calibration. &#4294967295;I described that the ADC is ideal. &#4294967295;Therefore, it is > not necessary to calibrate it. &#4294967295;(Calibration is another process, but during > it, you also must take into account that an ADC result, or code, > corresponds with an interval of input volatges inssted of a single point.)
The ADC is only one, tiny part in the aqcuisition system. There are any number of analog amplifiers and losses throughout, so even if you can describe the ADC in detail, you don't have any clue about how the voltages the ADC discretizes relate to whatever goes on in the real world. You need to calibrate your system in order to relate the numbers out of the ADC to any measurable quantity of the real world. Rune