Microsoft Word - 257-1778-5-LE ACTA IMEKO  ISSN: 2221‐870X  September 2015, Volume 4, Number 3, 4 ‐ 13    ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 4  Full information ADC test procedures using sinusoidal  excitation, implemented in MATLAB and LabVIEW  Vilmos Pálfi, Tamás Virosztek, István Kollár  Budapest University of Technology and Economics, Department of Measurement and Information Systems, Műegyetem rkp. 3., 1111, Budapest, Hungary        Section: RESEARCH PAPER   Keywords: ADC test; maximum likelihood; sine wave fitting; histogram test; MATLAB; LabVIEW  Citation: Vilmos Pálfi, Tamás Virosztek, István Kollár, Full information ADC test procedures using sinusoidal excitation, implemented in MATLAB and  LabVIEW, Acta IMEKO, vol. 4, no. 3, article 2, September 2015, identifier: IMEKO‐ACTA‐04 (2015)‐03‐02  Editor: Paolo Carbone, University of Perugia, Italy  Received February 14, 2015; In final form April 8, 2015; Published September 2015  Copyright: © 2015 IMEKO. This is an open‐access article distributed under the terms of the Creative Commons Attribution 3.0 License, which permits  unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited  Corresponding author: Vilmos Pálfi, e‐mail: palfi@mit.bme.hu    1. INTRODUCTION  Testing and characterization of analog-to-digital converters is an important field of measurement technology. A commonly used method for ADC testing is using a sine wave excitation signal, e. g. sine wave-based histogram test. In this latter procedure the device under test is excited with a possibly clean sinusoidal input, then a histogram is created which is used after correction for the probability density function of the sine wave to determine the transition levels of the converter. The standard method to estimate the parameters of the excitation signal is the least squares fitting algorithm. If the signal frequency is assumed to be known, the so-called three- parameter fit can be done which estimates the sine and cosine amplitudes and the DC offset level of the signal. In the case of unknown frequency, the four-parameter fit solves the problem. Dynamic errors of the ADC are often investigated using the FFT test which reveals the spurious components and harmonic distortion introduced by the device. The test methods mentioned above are described in detail in the IEEE standard [1]. Furthermore, this document defines rather strict conditions for the signal parameters which have to be fulfilled to ensure accurate results. However, users have to face some difficulties during the application of the standard procedures:  there is no method proposed to check the fulfilment of the conditions for the signal parameters (e.g. coherence, relative prime condition),  while the proposed methods are sensitive to the signal parameters, they are unable to recognize bad parameter settings which might lead to incorrect characterization of the converter,  correct signal parameters by themselves still do not ensure precise estimation of the sine parameters since the least squares method is sensitive to the nonlinearities of the ADC. The main goal of this paper is to present some advanced methods which are able to handle the above problems and provide unbiased information with minimum variance about the signal and ADC parameters, using only the measured record. MATLAB and LabVIEW implementation of the methods are freely available on the internet [2], these software tools are also presented here. ABSTRACT  Analog‐to‐digital  converters  and  the  need  to  test  these  devices  appeared  simultaneously.  Thus,  ADC  circuit  realizations  and  test  methods evolved also simultaneously. In the last decades several techniques have been elaborated and spread worldwide. These are  available  in  IEEE  standards  and  in  the  literature  as  well.  However,  standard  methods  do  not  support  the  recognition  of  incorrect  measurement settings. Accurate test results require careful choice of settings and calculated quality parameters of the ADC under test  are very sensitive to imperfections of the measurement setup. In addition, the requirements are different for each test technique and  the restrictions can even be contradicting (e.g. overdrive is recommended for histogram test and contraindicated for FFT test). This  paper presents solutions to perform the commonly used methods reliably and some advanced methods to increase the performance  of ADC quality parameter estimation. Implementations of the proposed algorithms are presented as well, with URL for download. ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 5  Section 2 explains in details the standard methods and their disadvantages. The advanced methods are presented in Section 3. The software tools are illustrated in Section 4. Finally, in Section 5 some experimental results are shown which confirm the advantages of the proposed methods. This work is based on and extends [5]. 2. STANDARD METHODS IN ADC TESTING  2.1. The sine wave histogram test  The histogram test is an effective way to estimate the code transition levels of an A/D converter. The ADC is tested with a pure sine wave which slightly exceeds the input range (see [3]). A histogram is created which shows the number of hits in each code bin. Let be the number of hits in code bin ( 0…2 1 for an ADC of bits). Then the cumulative histogram can be defined as: ∑ . (1) Let the model of the excitation signal be cos 2 (2) where , , and are the offset, amplitude, signal frequency and initial phase, respectively. Using the parameters , , the number of samples and the cumulative histogram , the th transition level can be estimated with the following formula: cos . (3) The signal parameters and can be estimated in units of the ADC quantum step, directly from the cumulative histogram (e.g. from the position of the 10 % and 90 % points), or making a least squares fit of the histogram. This is usually enough to execute the test in ADC units (absolute values can be obtained by using estimates of two arbitrary (but not too close) transition levels, matching to the measurement). Using such estimators will not introduce any errors in the INL and DNL characteristics of the converter [1]. However, determination of parameters like SINAD, ENOB, etc. requires estimation of all parameters of the input signal (that is, also the phase and frequency). The histogram test is very sensitive to the appropriate ratio of the signal frequency and of the sampling frequency . This ratio defines the relation between the number of samples ( ) and the number of periods ( ) in the record: . (4) Standard [1] requires the sampling be coherent (thus has to be an integer number), and and be relative primes. These conditions are very important because they guarantee the unbiased, minimum variance estimation of the transition levels (with respect to the given number of samples, see [4] and [5]). Unfortunately, there is no proposed method in the standard about inspecting the fulfilment of the above conditions. The requirements defined in the standard are important because this test technique compares the histogram of the quantized signal to the probability density function (PDF) of the sine wave. If a sine is quantized with an ideal ADC, its histogram will be very similar to the pdf, especially if the number of bits is high. Figure 1 shows such a histogram. The imperfections of the converter cause distortions in the histogram, since the number of hits in the code bin differs from the ideal case as the code is wider or narrower than the quantization step (see Figure 2). However, if the coherence condition is not fulfilled, then the number of periods in the signal is not integer. The samples of the fractional period might also cause distortions in the histogram, so transition levels among these codes will be estimated with systematic errors (see Figure 3). Figure 1. The histogram of a coherently sampled sine wave quantized by an ideal quantizer.  Figure 2. Histogram of a coherently sampled sine wave, quantized by a non‐ ideal quantizer.   Figure  3.  Distortion  in  the  histogram  of  the  sine  wave  caused  by  non‐ coherent sampling. ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 6  The conclusion is that only coherent sampling ensures unbiased results in the estimation. However, the relative prime condition still has to be fulfilled, otherwise the quality of the results might be harmed. The distribution of the phases of the samples is uniform in the interval , only if the greatest common divisor of and is 1. In that case every sample excites the ADC at a different voltage level, thus the transition levels can be estimated with maximum precision. Figure 4 illustrates the case when both coherence and relative prime conditions are fulfilled. The samples are distributed uniformly, the distance between two adjacent samples is everywhere the same. The transition levels can be estimated with the best precision because the uncertainty of their location depends on the distance between the samples close to each other in phase. Figure 5 shows the case when the signal is sampled coherently, but the relative prime condition is not fulfilled. The value of the greatest common divisor is 5 instead of 1, thus the samples are arranged into nodes. The distance between two nodes is much higher than its ideal value, thus the uncertainty of the locations of the transition levels is high which significantly increases the variance of the estimation. Finally, Figure 6 shows the case when the sampling is non- coherent. The distance between the phases varies, which leads to distortions in the histogram of the sine wave (see also Figure 3). 2.2. The least squares method  Precise estimation of the signal parameters is quite important in ADC testing. For example, the RMS value of residuals strongly depend on the estimated parameters. Equation (3) also shows that the amplitude and DC offset parameters have to be known as exactly as possible to determine the ADC characteristics precisely. The least squares method uses the following model of the sine wave: cos 2 sin 2 (5) where cos and sin . The advantage of this modified model is that it is linear in A, B, C, and nonlinear only in the signal frequency. The method minimizes the following quadratic cost function: ∑ cos 2 sin 2 . (6) Let denote the matrix of the derivatives of the residuals with respect to the parameters of the sine wave. The solution of the least-squares equation can be expressed in the following form: ̂ . (7) Solving the above equation iteratively (e.g. 5-6 times Newton-Gauss steps) will give the least squares estimator of the sine parameters. Despite of the efficiency of the method, it has several disadvantages:  the statistical properties of the estimation depends strongly on the saturation of the ADC, e.g. a 10 % overdrive leads to significant errors in the estimation of the sine parameters;  the presence of harmonic components also influence the precision of the estimator negatively;  the least-squares method assumes implicitly an ideal quantizer (so the stochastic model of noise is appropriate). However, this model is not valid for true ADCs with nonlinear characteristics which results biased estimation; Figure  4.  Distribution  of  the  phases  in  [0,  2π]  when  both  coherency  and  relative prime conditions are fulfilled.   Figure  5.  Distribution  of  the  phases  in  [0,  2π]  when  only  the  coherency condition is fulfilled.   Figure  6.  Distribution  of  the  phases  in  [0,  2π]  in  case  of  non‐coherent  sampling.   ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 7   the computational demands increase rapidly with the record length, however testing high resolution converters requires long measurements. 2.3. The FFT test  The purpose of the FFT test is to characterize the dynamic behaviour of the ADC by identifying spurious and harmonic components introduced by the device. The spurious free dynamic range (SFDR) shows the relation between the carrier and the largest spurious component in the signal. Overdrive of the ADC or non-coherent sampling significantly decrease the precision of the test results due to spectral leakage and harmonic components caused by clipping the peaks of the sine wave [6]. 3. ADVANCED METHODS  3.1. Main goals  The main goal of this paper is to present some advanced algorithms which are able to handle the problems introduced in Section 2. This way the user can perform accurate and reliable ADC testing. The methods perform the following tasks:  quality analysis of the measured data is provided by checking saturation and the fulfilment of the conditions required by the histogram test method. This step requires precise estimation of the sine parameters;  if the original record fails to fulfil the conditions, the coherent parts of the record are identified. If the coherent parts are too short compared to the original measurement, a new signal frequency is proposed and the measurement can be repeated following this suggestion. Above steps improve significantly the results of the histogram test and the FFT test since both methods provide the best results in the case of coherent sampling;  the signal parameters are determined using the maximum likelihood (ML) algorithm. The ML estimator is not influenced negatively by the (possibly) nonlinear characteristics of the ADC, thus the signal parameters, the fitting residuals and values such SINAD, ENOB can be determined with the best achievable precision. The algorithms are presented in details in the next subsections. It is important to notice that no a priori information is used or required, the source of the information (transition levels, signal parameters, etc.) is the measured data only. 3.2. Overdrive detection  Overdrive detection is quite important because distortions in the signal caused by clipping the peaks largely influence the results of sine wave fitting and the FFT test. The method identifies the samples in the measured signal which seems to be out of the full-scale range of the ADC. For this purpose, first the number of periods ( ) in the signal is determined using IpFFT with maximum sidelobe decay window ([7], [8] and [9]). In the next step, the three-parameters sine fit [1] is done to determine the , and parameters. Let be the output of the ADC, and , be the smallest and the largest output code of the converter. Based on [10], only those samples are used during the three-parameters fit algorithm for which the following condition holds true: . (8) Then the fit can be expressed as: cos sin . (9) The th sample of the signal is assumed to be overdriven if 1/2 or 1/2 (these are two virtual transition levels at the start and end of the full scale range). The overdriven samples are replaced (as in [6]) with the corresponding samples of : , 1/2 , 1/2 , otherwise . (10) Using ′ instead of during the FFT test and the sine fitting algorithm improves the results significantly. 3.3. Least‐squares fit in the frequency domain  Disadvantages of the standard, time domain least squares method (presented in Section 2) show that it is not the best method for the determination of the sine parameters. Most of the disadvantages can be handled if the fit is performed in the frequency domain. For this purpose, first ′ is windowed with the three-terms Blackman-Harris windows (see [11]), then the FFT of the windowed signal is computed. The Blackman- Harris window concentrates the information about the sine wave around its frequency very effectively, thus only a few points are used during the iterative estimation method. The method is explained in details in [12] and [13]. The main advantages are the following:  the Blackman-Harris window compresses the information around the sine and DC frequencies, thus the computational costs are reduced significantly;  the statistical properties of the estimator are the same compared to the original method. On low frequencies the frequency domain method outperforms the original algorithm;  due to the windowing the frequency domain method is much less sensitive to harmonic distortions in the signal. It is important to notice that nonlinearities in the ADC characteristics cannot be handled with least squares estimators regardless of the domain of the used samples. However, the influence of the characteristics is much more significant regarding parameters , and in comparison with , the number of periods in the signal. So is approximately unbiased and it was also shown in [13] that its statistical properties allow the estimator be used to check the fulfilment of the coherency and relative prime conditions. 3.4. Coherence analysis  The main purpose of the algorithm is to decide the suitability of the measured sine wave for histogram testing. This depends on the exact number of periods in the signal, denoted by . This can be written as 〈 〉 ∆ where 〈 〉 is the rounded value of and ∆ is the residual, thus |∆ | 0.5. The goal is to identify the coherent record parts in the measurement. For this purpose, the condition of Carbone and Chiorboli is used. It was shown in [14] that if 〈 〉 and are relative primes and |∆ | (11) hold true then the variance of the histogram test method does not increase noticeably in comparison with the ∆ 0 case, ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 8  thus the sampling can be assumed coherent from the histogram test’s point of view. Since the estimators are probability variables, a probabilistic approach of coherency analysis is recommended and presented. Let be the variance of the estimator. As it was shown in [13], is asymptotically Gaussian, unbiased and its variance can be determined in close form using the Jennrich-theorem (see [15]). Using the information above, the following probability can be determined: , . (12) The following probability is the same: , . (13) Using the latter form, the probability of coherency can be answered for different record lengths by selecting the values of and properly. Let be the rounded value of , thus 〈 〉. To determine the probability of fulfilling the Carbone- Chiorboli condition, the following values of and are required: . (14) If this probability is higher than a previously defined threshold (e.g. 95 %), the sampling can be assumed coherent. In addition, if the relative prime condition is also fulfilled, then the data is optimal for histogram testing. Otherwise, additional steps are required to identify the coherent parts of the signal. If the original record of samples fails to fulfil the requirements, then a new has to be determined. Let be the number of periods represented by one sample of the signal ( 0.5, this comes from the Nyquist-Shannon sampling theorem). The exact value of is unknown, but it can be estimated: . (15) Let be the number of periods for which the condition of Carbone and Chiorboli holds true, and the greatest common divisor of and is 1. Then can be estimated as: . (16) The variance of is also known: , . (17) This way the probability of coherence can be determined for any record length. Using the above procedure, the following steps are proposed to determine the optimal number of samples used for histogram testing:  estimation of the number of periods in the original record using the frequency domain estimator. As a result, we have and ;  determination of the possible number of integer periods in the record. This is stored in the vector, its elements increase from 1 to 〈 〉. The value of is also determined;  determination of the number of samples for each element of . Since these have to be integers, these are the rounded values of the ratio of the possible integer number of periods and . The results are stored in the vector;  for the elements of the exact number of periods is calculated and stored in the vector. Each element is a probability variable, the standard deviations are stored in / ;  the next step is the calculation of the values of the Carbone-Chiorboli bound for each element of . Once this is done, the probabilities of coherency can be determined for every value of . These probabilities are stored in the vector, and the greatest common divisors of the corresponding elements of and in the vector;  using the above vectors, the optimal number of samples can be determined. The proposed formula is the following: where , and are the th element of the , , vectors, respectively. The histogram test should be performed with that length for which is maximal;  if the value of is too small compared to the original record length, the needed adjustment of the signal frequency can be determined if the sampling frequency is known. From (4) one can derive that ∆ ∆ where ∆ is the required correction in the sampling frequency. Note that the frequency resolution of the signal generators is not enough high to adjust the frequency exactly by the proposed value. 3.5. The Maximum likelihood method  3.5.1. Motivation  The main weakness of the standard LS estimators for the sine wave parameters is the possible bias of them. Least-squares estimation can be biased in multiple cases, examples from the field of system identification are itemized in [16]. In ADC testing, this problem appears due to the nonideality of the real quantizers: the code transition levels are not distributed uniformly, thus code bins have different widths. However, the LS estimator finds the best fitting sine wave to the output codes of the device under test (occasionally to the nominal voltage values corresponding to the output codes), while the aim is to estimate the parameters of the input sine wave. The nonlinearity of the converter is not modelled in this standard method. The goal of maximum likelihood (ML) estimation of sine wave and ADC parameters [17], [21] is to provide minimum-variance unbiased (MVU) estimators for the analog excitation signal considering the non-ideal properties of the quantizer. The theoretical and practical aspects of ML estimation for ADC testing are to be itemized in the following subsections. 3.5.2. Modelling the measurement setup  For sine wave-based qualification of converter circuits, the measurement setup is simple. The analog side of the ADC under test is connected to a sine wave generator, while the digital record of the sine wave is post-processed to achieve the quantities that qualify the converter. However, the quality requirements for the sine wave generator are high. This device shall provide excellent frequency stability even for minutes and ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 9  harmonic distortion must be very low. These strict requirements have the following reasons: alteration of frequency, phase noise and multi-harmonic signals can be treated mathematically, nevertheless these options give too many degrees of freedom to the model. E.g. harmonic components in the record provided by the nonlinearity of the converter and provided by the analog generator cannot be distinguished. Similarly, a measured sine wave can be described as using additive noise and harmonic components as using frequency alteration and phase noise. The noise of the analog signal, the disturbances of the analog environment and the electronic noise of the ADC circuit are handled in a simple, but very lifelike noise model [18]. To examine the statistical and spectral properties of the measurement noise it is expedient to perform long measurements with short circuited analog input or zero excitation on the sine wave generator (the latter one is better to record the electromagnetic disturbances of the environment). Evaluating several measurements with different ADC circuits, the white noise model is apparently very realistic. This is important from the aspect of the mathematical form of the likelihood function as well, because the samples of the noise are assumed to be independent (see subsection 3.5.3.). Regarding the probability distribution of the noise, the results are less straightforward. We tried to confirm or deny the null hypothesis that these samples are from a well-known distribution using the Kolmogorov-Smirnov test. As the records contained up to 2 million samples, these hypothesis test results are reliable at high confidence level (p = 95-99 %). The distribution of the recorded populations were close to the Gaussian normal distribution, but showed significantly higher kurtosis: contained more outliers than it is expected in case of Gaussian noise. According to our experience, the best practice is to use a combination of Gaussian and Laplacian distribution to handle the outliers, but to keep the shape of distribution as well [19]. The model of the measurement and the parameters corresponding to the elements of the setup appear in Figure 7. 3.5.3. The likelihood function  The measurement record contains M samples of the digitally recorded sine wave. The observations are these samples of the quantized noisy signal. The likelihood function depends on the following parameters denoted by : , , , , , 1 ,⋯, 2 1 (18) where is the number of bits, denotes the cosine coefficient of the sine wave, is the sine coefficient of the sine wave, denotes the DC offset of the excitation signal. The frequency of the sine wave is denoted by (the sampling frequency is known), denotes the standard deviation of the additive noise on the analog signal, and the code transitions levels of the quantizer (from the lowest to the highest) are denoted by 1 , . . . , 2 1 , respectively. The likelihood of the measurement can be expressed using the following equation: ∏ (19) where denotes the th recorded sample of the sine wave and is a discrete random variable corresponding to the th.sample of the record. To calculate the distribution of , it is necessary to calculate the th sample of a pure sine wave with given parameters , , and : cos 2 sin 2 . (20) The threshold levels of the quantizer (code transition levels) and the noise model appear in the following formula, which gives the discrete distribution of random variable : N , , 1 N , , (21) where N , denotes the cumulative distribution function of the noise with expected value and standard deviation . Using the cumulative distribution function (CDF) of Gaussian distribution as NCDF is usually a very good approximation (see subsection 3.5.2). In this likelihood function the following a priori information is used:  the noise is white (samples of the noise are independent);  the analog excitation is a sine wave with additive, almost Gaussian noise;  the quantizer is described with its sampling frequency ( , constant in a measurement) and code transition levels ( is the voltage value which results digital code 1 with 50 % probability and with 50 % probability as well). The maximum likelihood estimators can be achieved optimizing this likelihood function with respect to the parameters stored in : argmax . (22) 3.5.4. Challenges of optimization  The most important problem is the computational demand of the optimization which strongly depends on the number of parameters. Using a b-bit quantizer the number of parameters is 2 4, the number of restrictions is 2 1, thus the parameter space increases exponentially with respect to the number of bits. The entire computational demand grows even faster: let n denote the number of parameters, thus depending on the optimization algorithm, the operations have the following computational complexity:  calculating the first-order partial derivatives (the gradient vector): ~ ;  calculating the second order partial derivatives (the Hessian matrix): ~ ;  inverting the Hessian matrix: ~ . This way performing the optimization process on the entire parameter space requires unacceptable efforts for a regular 12- bit, 16-bit or higher resolution ADC. To handle this problem one of the following approximations shall be used:  the code transition levels are estimated from the sinusoidal record using histogram test [2]. These values are considered to be fixed and will not be adjusted later. This method reduces the parameter space to 5 dimensions, however brings along all the Figure 7. Measurement setup for ADC testing.   ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 10  problems that can appear in sinusoidal histogram testing [4];  the nonlinearity of the quantizer is parameterized: the code transition levels are not estimated one by one, but the entire static transfer characteristics is described using fewer (from 5 up to 15) parameters. This way the number of parameters of the likelihood function remains between 10 and 20, so the optimization can be performed without excessive efforts. For parameterization, Chebyshev [20] and Taylor polynomials or Fourier-coefficients can be used. The information regarding the nonlinearity is described using fewer quantities in this case, however the estimation of these polynomial coefficients brings along less variance than the estimation of the single code transition levels. 3.5.5. Numerical recipes to optimize the likelihood function  The likelihood function in the reduced parameter space can be optimized multiple ways to achieve approximate maximum likelihood estimators:  derivative-based methods: the simple gradient descent which only requires the first order partial derivatives, the Gauss-method that implies the calculation of the Hessian matrix and the generalized Levenberg-Marquardt method where the Hessian is used as well (instead of formula from the Jacobian matrix). Calculation of the Hessian in each iteration cycle can be bypassed using Quasi-Newton methods (e.g. DFP, BFGS or Broyden);  simplex downhill (Nelder-Mead) method: does not require to calculate derivatives (the objective function must not even be differentiable), however the number of iterations and cost function evaluations can be high (depending on the shape of the minimum/maximum and the termination criteria);  differential Evolution: a genetic algorithm used to find the global optimum of the objective function. This method does not require derivatives and is able to escape from local extrema. On the other hand it requires large number of cost function evaluations and the convergence is partially based on heuristics; In our software implementation available on the web [8] a gradient-based method is used, nevertheless other algorithms can be efficient and their efficient usage is also subject of investigation. 4. SOFTWARE TOOLS FOR ADC TESTING  Previous sections demonstrated the importance of the quality analysis on the measured data before the test methods are performed. The algorithms have to be executed in a fixed order to ensure best results. Every method on a later stage uses the information provided by previous methods. The main tasks are the FFT test, histogram test and estimation of the sine parameters, these are supported by the other algorithms. The data processing chain can be seen on Figure 8. First the overdrive detection method is performed which identifies the samples clipped by the ADC. These are replaced by their estimated value. This step is done automatically in the LabVIEW tool, while in MATLAB the user is warned (see Figure 9). As a result, the results of the FFT and the least squares fit in the frequency domain are improved. Once the latter is done, the coherency analysis can be performed and the optimal records length can be determined (Figure 10). At this point the processed record can be assumed coherent, thus the histogram and FFT tests will provide valid results. Once the transition levels are known, the maximum likelihood estimation method can be executed. This will estimate the parameters of the sine and noise unbiasedly and with a variance which is very close to the theoretical limit (see Figure 11). This serves the accurate determination of some ADC quality parameters such as ENOB, SINAD, etc. Figure 8. The sequence of methods in the ADC testing software.   Figure 9. Classification of the measurement in the MATLAB tool.   Figure 10. Results of the coherency analysis. The user can  choose among  the best 3 options.   Figure 11. Results of the maximum  likelihood method. Towards the signal  and noise parameters, SINAD and ENOB are also determined.   ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 11  5. EXPERIMENTAL RESULTS  5.1. Simulation results  This subsection presents the test results of the coherence analysis algorithm. During the test a 12 bit quantizer was used, the characteristics can be seen in Figure 12. In the test sine waves were generated and the initial phase and the number of periods were random variables. The initial phase was uniformly distributed in the interval 0,2 . The number of periods, , was also distributed uniformly in 8.95,9.05 . The aim of this selection was to model that users try to fulfil the coherence condition, but due to the errors in the signal and sampling frequencies he fails to do so. The value of the overdrive and was set to 10 % and 215. The model of the sine wave was the following (according to (2)): 1.1 cos . (23) To simulate real-like circumstances and to model the imperfections of the signal generator, independent Gaussian noise ( ) was added to the samples of the signal with 0 mean and LSB standard deviation: E 0,var 1 . (24) A harmonic component ( ) was also added with 1 LSB amplitude and double frequency of the carrier: cos . (25) The test signal was the sum of the carrier, the noise and the harmonic component: . (26) 100 tests were run where first the histogram test was performed using the whole record, then using the optimal record length after coherence analysis. Figure 13 shows the standard deviation of the error of the histogram test for the case when the whole record was used. Figure 14 shows the standard deviation when the record was truncated to the optimal length. The comparison of the figures shows that the coherence analysis method successfully reduced the errors in the estimation. Simulation results for the maximum likelihood method and comparison with the LS estimator can be found in [22]. In [13] a comprehensive study is presented about the frequency domain LS estimator. 5.2. Experimental results  The presented algorithms were tested with real measurement data. A National Instruments ADC of 16 bits and =200 kHz sampling frequency was used for data quantization. The excitation signal was provided by a Brüel&Kjaer Type 1051 sine wave generator. Since a slight overdrive of the ADC is recommended for histogram testing the signal amplitude was set to 120 % of the full scale range of the converter. The frequency was set to =97 Hz and =220 samples were collected. The nominal values of the frequencies and the record length fulfil both the coherency and relative prime conditions. In the first test, the original least-squares method [1] was compared to the frequency domain method with overdrive detection. The algorithms estimated the four parameters of the sine wave, than SINAD and ENOB were determined using the fitting residuals ( ): ∑ (27) √ (28) . . . (29) In (29) the value of was substituted for for values higher than the full scale of the ADC. The results of the comparison can be seen in Table 1. Figure 12. ADC INL and DNL characteristics.   Figure 13. Standard deviation of the estimation error of the histogram test when the whole record was used.   Figure 14. Standard deviation of the estimation error of the histogram test after the coherence analysis.   Table 1. Comparison of the standard and the proposed least‐squares fitting  method.  Parameter Original method Proposed method A [LSB] -30834.5 -30886.4 B [LSB] 12140.2 12160.1 C [LSB] 32789.8 32793.3 J 211.01 211.05 SINAD [dB] 48.240 79.114 ENOB 7.721 12.849 ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 12  The results show that harmonic components introduced by the saturation of the ADC cause huge errors in the amplitude and DC offset parameters of the sine. However, detection and substitution of samples around the peaks improved the results significantly. In the next step the effect of the coherency analysis algorithm was studied. Two histogram tests were performed, one for the whole record and one for the coherent part of the signal. Coherency analysis showed that the optimal record length for histogram testing is =288227 samples which is only the 27 % of the original length despite the nominal values of the sampling and sine frequency fulfilled every requirement. Figure 15 shows the results of the INL estimations and the difference between the results. In the first case the histogram test was performed using a non-coherent record, thus the results are distorted. The error curve showed that 57 transition levels were estimated with an error higher than 3 LSB, 4113 of them were estimated with an error higher than 2 LSB. The value of the average estimation error is 0.957 LSB. It is very important to notice that 288227 samples are not enough to test accurately a 16 bit ADC, the presented software would recommend an adjustment in the signal frequency (see Section 4). The new record length shows the amount of independent information in the whole record, thus ~70 % of the samples do not provide new information about the transition levels. In addition, it is still better to perform the histogram test with the truncated record since the whole record introduces bias in the estimation, but the variance of the estimation is the same for both records due to the same amount of information. Finally, the results of the least-squares method and the maximum likelihood method were compared. The INL curve of the ADC shows that the characteristics are nonlinear, thus the least-squares method is not able to provide unbiased results. The ML method uses the transition levels of the converter during the parameter estimation process so the results are precise for nonlinear converters also. Table 2 shows the results. The ENOB and SINAD parameters were found to be smaller using the ML method. The explanation if that LS fit minimizes the error, thus the values of above parameters are maximized. However, the true values are provided by the ML estimator which maximizes the probability with respect to the parameters. 6. CONCLUSIONS  In ADC testing, users have to face some difficulties during the application of the standard methods. This paper presented some advanced methods which are able to handle the problems of the original procedures. The implementation of the proposed algorithms was also presented and experimental results showed that the new methods provide accurate and reliable information about the ADC and sine wave parameters. REFERENCES  [1] IEEE Standard for Terminology and Test Methods for Analog- to-Digital Converters," IEEE Std 1241-2010 (Revision of IEEE Std 1241-2000), pp. 1-139, Jan. 14, 2011. DOI: 10.1109/IEEESTD.2011.5692956 [2] Virosztek, T., Pálfi V., Renczes B., Kollár I., Balogh L., Sárhegyi A., Márkus J., Bilau Z. T., ADCTest project site: http://www.mit.bme.hu/projects/adctest, 2000-2014 [3] Blair, J., "Histogram measurement of ADC nonlinearities using sine waves," IEEE Transactions on Instrumentation and Measurement, vol.43, no.3, pp.373-383, Jun 1994. DOI: 10.1109/19.293454 [4] Vilmos Pálfi, István Kollár, “Improving the results of the histogram test using a fast sine fit algorithm”, Proc. of 19th IMEKO TC4 Symposium, Barcelona, Spain, 2013. paper 118. URL: http://www.imeko.org/publications/tc4-2013/IMEKO- TC4-2013-118.pdf [5] Vilmos Pálfi, István Kollár, “Reliable ADC testing using LabVIEW”, Proc. of 20th IMEKO TC4 Symposium, Benevento, Italy, 2014. pp. 237-241, URL: http://www.imeko.org/publications/tc4-2014/IMEKO-TC4- 2014-259.pdf [6] Xu, Li, Siva Kumar Sudani, and Degang Chen. "Efficient Spectral Testing With Clipped and Noncoherently Sampled Data." IEEE Transactions on Instrumentation and Measurement, 63.6 (2014): 1451-1460. DOI: 10.1109/TIM.2013.2292273 [7] Belega, Daniel, and Dominique Dallet. "Frequency estimation via weighted multipoint interpolated DFT." Science, Measurement & Technology, IET 2.1 (2008): 1-8. DOI.: 10.1049/iet- smt:20070022 [8] Belega, Daniel, and Dominique Dallet. "Efficiency of the three- point interpolated DFT method on the normalized frequency estimation of a sine-wave." Intelligent Data Acquisition and Advanced Computing Systems: Technology and Applications, 2009. IDAACS 2009. IEEE International Workshop on. IEEE, 2009. DOI: 10.1109/IDAACS.2009.5343034 [9] Belega, Daniel, Dominique Dallet, and Dario Petri. "Accuracy of sine wave frequency estimation by multipoint interpolated DFT approach." IEEE Transactions on Instrumentation and Measurement, 59.11 (2010): 2808-2815. DOI: 10.1109/TIM.2010.2060870 [10] Kollár, István, and Jerome J. Blair. "Improved determination of the best fitting sine wave in ADC testing." IEEE Transactions on Instrumentation and Measurement, 54.5 (2005): 1978-1983. DOI: 10.1109/TIM.2005.855082 [11] Albrecht, Hans-Helge. "A family of cosine-sum windows for high-resolution measurements." Acoustics, Speech, and Signal Table 2. Comparison of the least‐squares and maximum likelihood methods. Parameter LS ML A [LSB] -30886.4 -30886.4 B [LSB] 12160.1 12160.1 C [LSB] 32793.3 32792.8 J 211.05 211.05 SINAD [dB] 79.114 78.918 ENOB 12.849 12.817 Figure  15.  Comparison  of  results  of  the  histogram  tests  using  the  whole record and the coherent part only.   ACTA IMEKO | www.imeko.org  September 2015 | Volume 4 | Number 3 | 13  Processing, IEEE International Conference on. Vol. 5. IEEE, 2001. DOI: 10.1109/ICASSP.2001.940309 [12] Pálfi, Vilmos, and István Kollár. "Efficient execution of ADC test with sine fitting with verification of excitation signal parameter settings." Instrumentation and Measurement Technology Conference (I2MTC), 2012 IEEE International. IEEE, 2012. DOI: 10.1109/I2MTC.2012.6229502 [13] Pálfi, Vilmos, and István Kollár. "Acceleration of the ADC test with sine-wave fit." IEEE Transactions on Instrumentation and Measurement, 62.5 (2013): 880-888. DOI.: 10.1109/TIM.2013.2243500 [14] Carbone, Paolo, and Giovanni Chiorboli. "ADC sinewave histogram testing with quasi-coherent sampling." IEEE Transactions on Instrumentation and Measurement, 50.4 (2001): 949-953. DOI: 10.1109/19.948305 [15] Jennrich, Robert I. "Asymptotic properties of non-linear least squares estimators." The Annals of Mathematical Statistics (1969): 633-643. DOI: 10.1214/aoms/1177697731 [16] Schoukens, Johan, and Rik Pintelon. Identification of linear systems: a practical guideline to accurate modelling. Elsevier, 2014. URL.: http://goo.gl/Dg7uuV [17] Balogh, László, István Kollár, and Attila Sárhegyi. "Maximum likelihood estimation of ADC parameters." Instrumentation and Measurement Technology Conference (I2MTC), 2010 IEEE. IEEE, 2010. DOI.: 10.1109/IMTC.2010.5488286 [18] Tamás Virosztek „ADC testing in practice, using maximum likelihood estimation: Report in Students' Scientific Circle (TDK)” 49 p., 2013. URL: http://mycite.omikk.bme.hu/doc/149632.pdf [19] B Renczes, I Kollár, P Carbone, A Moschitta, V Pálfi, T Virosztek Analyzing Numerical Optimization Problems of Finite Resolution Sine Wave Fitting Algorithms – accepted for publication at IEEE Instrumentation and Measurement Technology Conference (I2MTC), May 11-14 2015, Pisa, Italy [20] Attivissimo, F.; Giaquinto, N.; Kale, I., "INL reconstruction of A/D converters via parametric spectral estimation," Instrumentation and Measurement, IEEE Transactions on , vol.53, no.4, pp.940,946, Aug. 2004 DOI: 10.1109/TIM.2004.831508 [21] Šaliga, Ján, et al. "A comparison of least squares and maximum likelihood methods using sine fitting in ADC testing." Measurement 46.10 (2013): 4362-4368. DOI.:10.1016/j.measurement.2013.05.004