ADC Nonlinearity INL and DNL
Characterise an ADC from a histogram of codes captured under a full-scale ramp, computing differential and integral nonlinearity in LSBs.
Constraints
- Input is a code histogram.
- DNL of a code is its bin width divided by the ideal width, minus 1.
- INL is the running sum of DNL.
- Discard the first and last codes, which saturate.
- Report the peak absolute DNL and INL.
- A perfectly linear ADC gives zero for both.
1function [dnl, inl] = adc_linearity(histogram)2% TODO3end