# [SOLVED]Cancelling gain error of an ADC

Status
Not open for further replies.

#### dirac16

##### Member level 2 I have read that in order to measure the DNL/INL errors of an ADC one has to nullify the gain and offset error. It's simple to compensate the offset error by shifting the curve either in the x or y direction. However, the gain error compensation is less obvious to me. How do you usually correct the gain error in software?

Solution
Obviously you have to test against a standard V swept over range
of A/D or range of interest. You can then do :

1) Least squares error fit equation using the cal values to a-priore
determine equation coefficients.

2) Power curve error fit, typical 5'th order, depends on resolution
you are dealing with.

3) Table lookup and interpolation between cal points.

All possibilities for solution.

Another metod done at manufacturing - Regards, Dana. Obviously you have to test against a standard V swept over range
of A/D or range of interest. You can then do :

1) Least squares error fit equation using the cal values to a-priore
determine equation coefficients.

2) Power curve error fit, typical 5'th order, depends on resolution
you are dealing with.

3) Table lookup and interpolation between cal points.

All possibilities for solution.

Another metod done at manufacturing - Regards, Dana.

• dirac16

#### barry I think you have to calculate the slope of two lines: the measured data and the ideal data. You then multiply your measured data by (ideal slope/measured slope).

• dirac16

### dirac16

Points: 2

#### frankrose Sometimes, when ADC is quite linear, simple start/endpoint curve fit is enough.
For example you can measure the gain between code 1 and code 2^N-1, fit a straight line on these points. Line steepness difference from ideal is the gain error, normally its unit is LSB.
Better method, as mentioned above to fit a curve with least mean square approximation on data. I don't know other methods, these were enough for my purposes.

#### dirac16

##### Member level 2 Thank you guys. The answers are all appreciated!

Status
Not open for further replies.