Professional Documents
Culture Documents
1 s2.0 S0263224113001966 Main
1 s2.0 S0263224113001966 Main
1 s2.0 S0263224113001966 Main
Measurement
journal homepage: www.elsevier.com/locate/measurement
a r t i c l e i n f o a b s t r a c t
Article history: ADC test methods require the best possible reconstruction of the input signal of the ADC
Available online 29 May 2013 under test from the acquired, therefore erroneous, ADC output data. The commonly used
least squares (LS) fit and the recently introduced maximum likelihood (ML) estimation
Keywords: are competing methods. This paper presents a simulation-based comparative study of
ADC test these estimation methods with the goal to investigate the behavior of both methods and
Maximum likelihood estimation to determine their limits. Two alternative algorithms for the calculation of the maximum
Least squares method
likelihood fit are considered (gradient-based minimization and differential evolution).
LS method
Four-parameter fit
The main finding is that while for low-INL (linear) ADCs the two methods (LS and ML) give
Signal recovery similar results, for practical (almost always nonlinear) ADCs ML is definitely better.
Estimation of signal parameters Ó 2013 Elsevier Ltd. All rights reserved.
Gradient-based method
Differential evolution
0263-2241/$ - see front matter Ó 2013 Elsevier Ltd. All rights reserved.
http://dx.doi.org/10.1016/j.measurement.2013.05.004
J. Šaliga et al. / Measurement 46 (2013) 4362–4368 4363
2. Fitting methods Searching the extreme value can be a complex task and
it can be performed only by an appropriate numerical
The general setup for dynamic ADC testing is shown in method.
Fig. 1. To perform simulation experiments a few software
modules including non-ideal ADC model with optional test 2.3. Implementation of fitting and comparison
specific INL were developed. The modules enable simulat-
ing real ADC test according to Fig. 1. LS fit for a sine wave was implemented according to stan-
dards [1–3] in the form of 4-parameter fit [11]. When the
2.1. Least Squares (LS) fit ADC was overloaded, LS fit was made both to the full record
as described in the standard, and/or to the record with the
LS fitting is a well known and very often used procedure overloaded samples discarded, in order to decrease bias.
for recovering distorted and noisy signals in testing and The ML algorithm is more complex, since for proper
measurements [1]. Estimation of parameters of ADC input estimation the transition levels need also to be estimated.
signal is obtained from minimization of the cost function Since for a 8-bit ADC 260-parameter minimization is
CFLS: needed [6,7], this is not practical with full attempt. The lev-
els T[k] were determined from the cumulative histogram.
X
N1
minðCF LS ðaÞÞ ¼ min ðyðnÞ f ða; nÞÞ
2
ð1Þ This provides values which are close to the best (and thus
a a to the ML) estimates.
n¼0
For the following, T[k] denotes the comparison level be-
where f(a, n) is the time model of the test signal, a is a vec-
tween codes k 1 and k, with k = 1, 2, . . . , 2b 1 (for input
tor of its unknown parameters, and y(n) are digitized sam-
level T[k], probabilities of the output codes k 1 and k are
ples of test signal applied to the input of ADC under test,
equal to 50%. respectively).
taken at sampling instances tn. Solution of (1) leads to a
The possible output codes are 0, 1, . . . , 2b 1. NCH[k]
system of equations which is nonlinear in the cases of
(for each code) denotes the normalized cumulative histo-
the four-parameter fit of a sine wave or for dual slope
gram: the sum of the relative frequencies for all codes
exponential stimulus. Solution of such a nonlinear system
c 6 k. Thus, NCH[2b 1] = 1.
requires application of an appropriate numerical method,
The cumulative histogram contains information only
increasing the complexity of the LS method.
about the T[k] values which are excited. This means that
with a sine wave of carefully chosen (almost full-range,
2.2. Maximum likelihood method
but not overloaded) amplitude almost all T[k] values can
be estimated – at least those which are excited in this
Maximum likelihood method comes from estimation
experiment. As ‘‘calibration step’’ the two extreme but still
theory and looks for the most probable ADC input signal.
excited T[k] s (T[k1] and T[k2]) were set to the corre-
ML fitting is based on maximization of a likelihood func-
sponding nominal values (k 0.5). For the not measured
tion L(a):
T[k] s (the levels outside the above values) the nominal
Y
N1 values are set: (k 0.5).
maxðLðaÞÞ ¼ max PðyðnÞ ¼ Y a;q;r ðnÞÞ; ð2Þ For k1 < k < k2, assuming that the noise is small, the
a;q;r a;q;r
n¼0
amplitude and dc level of the sine wave can be estimated
where q is the vector of ADC transition code levels, r is the from the cumulative histogram values for the above ex-
standard deviation of the Gaussian noise of the input elec- treme T[k] s [10]. This can be done by a simple manipu-
tronics, assuming here that the noise samples are indepen- lation on the CDF (Cumulative Density Function):
dent. P(y(n) = Y(n)) is the probability that given the signal 1 x l
model, the nth ADC output sample y(n) is equal to the mea- FðxÞ ¼ arcsin þ 0:5 ð4Þ
p A
sured output value Y(n), which represents a possible output
code. To simplify the maximization L(a), minimization of the Since NCH(ki 1) gives the probability (F(x)) that x < T[ki],
sum of negative logarithms of probabilities P() is preferred. the equations to be fulfilled for l and A are
Thus the parameters are determined for the input CDF, and 1. Estimation error D defined as RMS value of the difference
its inverse can be applied to have the T[k] s without the between estimated signal and the exact input signal.
bias due to the non-uniform distribution of the sine wave: 2. Difference between SINADs calculated from LS fit, or
from ML fit and the value calculated from exactly
TðkÞ ¼ l A cosðp NCHðk 1ÞÞ; k known ADC stimulus.
¼ k1 þ 1; . . . ; k2 1 ð8Þ
These values can be evaluated in simulation only, because
P to do this, the exact excitations are needed.
Now the log-likelihood function CF ¼ logðP n Þ can be
The RMS value was chosen because it is the basic
maximized via the five parameters (A, B, C, f0, r).
descriptor of the error which has influence on nearly all fi-
This minimization was implemented in two ways (gra-
nal ADC dynamic parameters such as ENOB and SINAD.
dient-based method: Levenberg–Marquardt in Matlab, and
Moreover, a simple comparison of differences between,
the DE method: GlobalOptimization.vi in LabVIEW [8]).
e.g., sine wave amplitudes is not well readable from the
The results were approximately the same.
point view of its influence on the final error in calculation
DE methods approach the optimum by mutating and
of ADC parameters. The estimation error Dmethod (RMS va-
improving the candidate parameters from the initial ones.
lue of the difference between the recovered signal by a gi-
Fig. 2 illustrates how the algorithm works. GlobalOptimal-
ven method and the known exact one) was calculated
ization.vi uses (if available) multi-core processing, which
according to the formula:
speeds up the calculation of the best parameters.
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
For comparison of the accuracies of signal recovery 1 XN1
achieved by LS and ML methods two parameters were Dmethod ¼ ðymethod ðnÞ yexact ðnÞÞ2 ; ð9Þ
N n¼0
determined:
INL [LSB]
Comparison of SINADs calculated from LS and ML fits to
SINAD calculated from the exact value of stimulus was cal- 0,0
culated only in tests, where the stimulating sine wave did
not overload ADC full scale as it is required by standards. -0,5
SINAD in dB was calculated according to the standard for-
mula defined in [1]: -1,0
0 64 128 192 256
Amethod
SINADmethod ¼ 20 log ; ð10Þ bin
NADmethod
Fig. 4. Nonlinear INL of a real ADC used in the following simulations.
where Amethod is RMS value of sine wave recovered by a gi-
ven method or from the exactly known ADC stimulus and
NADmethod is rms value of noise and distortion given by: National Instruments was implemented in the simulation
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
1 XN1 software. The real INL was simplified by rounding the low-
NADmethod ¼ ðyrecord ðnÞ ymethod ðnÞÞ2 ; ð11Þ est bits, in order to be equivalent to INL of a 8 bits ADC as it
N n¼0
is shown in Fig. 4. Approximate maximum likelihood esti-
where yrecord(n) are digitised samples recorded on ADC mates of the transition levels were determined from the
output. Note that the influence of NAD is not very signifi- sample record via the histogram method [1], with the stan-
cant in SINAD if it is much smaller than standard deviation dard correction for the sine wave, as described in Sec-
of the quantization noise, 0.3 LSB (LSB is the least signifi- tion 2.3. In our view, this is the maximum information
cant bit: the resolution of the ADC: range/2^b with b the that can be extracted from the record for the T[k] values.
number of bits), but more significantly contributes to During the ML fit, these estimates were kept constant,
ENOB. and the other five parameters were optimized.
The behavior of the fits for a nonlinear 8-bit ADC and
3. Simulation results 500 coherently taken samples with standard deviation of
noise r = 0.2 LSB for varying ADC overloading were investi-
3.1. LS vs. ML estimation gated and the result is shown in Fig. 5. If the input signal
covers ADC range up to 100 percent, both methods give
The first experiments were performed on linear ideal small errors, but ML errors are smaller than LS.
ADCs with different resolutions (up to 16 bits), and stan- The RMS value of the difference of the LS fit from the ex-
dard deviation of noise equal to 0.2 LSB, to represent ADC act stimulus quickly increased if the input stimulus even
code alternating behavior. One would expect that ideal only slightly overloaded the ADC input range and if LS fit
(linear) ADC characteristic causes similar LS and ML errors. was applied on the whole record, therefore the overloaded
Fig. 3 shows a zoomed segment of record of digitized stim- samples were discarded in LS fits. Fig. 6 shows the fitting
ulus from the ideal 8-bits ADC together with exact stimu- errors for nonlinear ADC. The estimation errors for both fits
lus, and recovered signals. Stimulus did not overload ADC are small, but the ML fit having smaller error.
full scale. The differences between both recovered signals The resulting practical conclusions coming from the
and exact stimulus are hardly visible. performed experiments is that
The difference between the LS and ML fits is visible on
the example of a nonlinear ADC. The following tests were the dominating error factor in ‘‘blind’’ LS fitting is ADC
focused on effects on ADC nonlinearity at recovering the overloading (if this happens). ML fit is much better for
test signals by LS and ML fits. any, even very small, ADC overloading and it does not
To approximate as much as possible a real ADC in sim-
ulations, the INL measured on the real ADC in USB 6009 by
252
251
amplitude [LSB]
250
250
amplitude [LSB]
248 249
LS fit LS fit
246 248
ML fit ML fit
244 247
stimulus
stimulus 246
242 ADC output
ADC output 245
240 120 140 160 180 200 220
180 200 220 240 260 280 time [samples]
time [samples]
Fig. 5. Comparison of LS and ML fits, with digitized and exact stimulus
Fig. 3. Comparison of LS and ML fit, digitized and exact stimulus (zoomed (zoomed time segment) for nonlinear ADC characteristics. The result of
time segment) for ideal ADC characteristics. ML estimation is much closer to the true signal than that of the LS fit.
4366 J. Šaliga et al. / Measurement 46 (2013) 4362–4368
1.0 0.5
ML 0.4
0.8
Dmethod [LSB]
Dmethod [LSB]
LS 0.3
0.6 LS ML
0.2
0.4 0.1
0.2 0.0
-0.1
0.0
90 110 130 150 170 190
ADC input range covering [%] number of samples in record
Fig. 6. LS vs. ML fit for overloaded ADC (100% is equal to ADC full scale). Fig. 8. Dependence of estimation error on number of samples for 8 bit
LS fit uses pre-processed record. ADC for LS and ML fit.
Dmethod [LSB]
even with pre-processed data used for LS fit, the error of LS ML
the ML fit is somewhat smaller than that of the LS fit 0.2
(Fig. 6).
0.1
-0.1
In all the simulations below, the nonlinear ADC charac- 0.01 0.02 0.05 0.1 0.2 0.4 0.6 0.8 1
teristic as in Fig. 4 was used. [LSB]
The next study was focused on the accuracy of recov-
Fig. 9. Dependence of LS and ML fit error on noise level.
ered stimulus for different resolutions of the ADC. The test
conditions were that the ADC under test was just not over-
loaded, r = 0.2 LSB and the length of record was
N = 2^(b + 2), where b is the ADC resolution in bits. The re- The next study examines the effects of different fitting
sults are the mean values of D with the standard deviations methods on precision of calculation of SINAD. To charac-
estimated from 20 experiments. terize the error, the theoretical SINADREF was calculated
The estimation errors (Eq. (8)) are shown in Fig. 7. from the precisely known stimulating sine wave, and
The achieved results show that the error of the ML fit is quantisation noise was achieved as a difference of the re-
definitely smaller than that of the LS fit. corded samples and the precisely known stimulating sine
The next experiment was focused on dependence of wave by Eq. (10). SINADLS and SINADML were calculated
estimation error D on number of samples in the record from sine wave recovered by LS and ML fit, respectively.
with coherent sampling. Fig. 8 shows this dependence for Fig. 10 shows the deviation of SINADLS and SINADML
8-bits ADC and r = 0.2 LSB. The errors of the ML fit are def- from SINADREF, respectively, as well as variance of repeated
initely smaller. testing as a dependence on ADC noise r. The results were
The following experiments were focused on the influ- achieved for nonlinear 8 bit ADC and the record length
ence of the ADC noise that causes alternation of ADC out- N = 2048 samples taken by coherent sampling.
put codes. The results achieved for 8 bits ADC and 2048 The errors of SINAD calculated in the LS fit decrease
samples in record are shown in Fig. 9. According to these with increasing noise. This can be explained by noticing
simulations, the ML fit has smaller error. that the input noise acts like dither, thus quantization
noise is becoming more and more independent of the sig-
nal for larger noise amplitude.
0.7 Fig. 11. shows again results achieved for a nonlinear
ADC and for different numbers of samples in a coherent re-
Dmethod [LSB]
0.6
LS ML
0.5 cord. Again, the error of the ML fit is strikingly smaller.
0.4
Fig. 12. shows errors of SINAD calculated from ML and
LS fits as functions of the maximum nonlinearity of the
0.3
nonlinear ADC. Again, the ML method gives stable INL
0.2
independent results within the whole tested range of
0.1 ADC nonlinearity, while the error of LS increases with
0.0 increasing nonlinearity. This can be explained by the fact
5 6 7 8 9 10 11 12 13 14
that LS fitting does not model the nonlinearity in any
ADC resolution [bit]
way, while ML fitting does, even if this performs approxi-
Fig. 7. Dependence of estimation error on number of ADC bits for LS and mate modelling only (2048 samples in the record, i.e.
ML fit. approximately four samples in a bin).
J. Šaliga et al. / Measurement 46 (2013) 4362–4368 4367
INL [LSB]
1.0
0.0
0.5
0.0 -0.1
-0.5 -0.2
-1.0
-0.3
-1.5 0 64 128 192 256
0.01 0.02 0.05 0.1 0.2 0.4 0.6 0.8 1 bin
σ [LSB]
Fig. 13. Nonlinear INL of an ADC model AD9287.
Fig. 10. Error of SINAD calculated from LS and ML fit for different
variances of ADC noise.
249
248
SINADmethod -SINADREF [dB]
amplitude [LSB]
2.5 247
2.0 246
1.5 245
LS ML
LS fit
244
1.0 ML fit
243
0.5 stimulus
242
0.0 ADC output
241
-0.5 190 210 230 250 270 290
time [samples]
-1.0
Fig. 14. Comparison of LS and ML fits, with digitized and exact stimulus
(zoomed time segment) for ADC model AD9287. The result of ML
number of samples in record estimation is much closer to the true signal than that of the LS fit.
Fig. 11. Error of SINAD calculated from LS and ML fit for nonlinear ADC
and different number of samples in coherent record.