Iterrative correction of measurement with averaging of dithered samples
Abstract
Self-calibration techniques could eliminate measurement errors caused by time changes and component aging. For ADC performance enhancement also averaging is necessary. In the paper the iterative measurement error correction method is presented in combination with averaging. Dither theory for Gaussian noise has been used for exhibition of averaging abilities in ADC characteristic improvement. Experimental ENOB value improvement is more than 1.5 bit.
Full text
358 Advances in Electrical and Electronic Engineering ITERRATIVE CORRECTION OF MEASUREMENT WITH AVERAGING OF DITHERED SAMPLES M. Kamenský 1) , K. Ková 2) 1) Department of Measurement, , Faculty of Electrical Engineering and Information Technology, Slovak University of Technology, Ilkoviova 3, 812 19 Bratislava, Slovak Republic, tel.: +421 2 602 91 393,email: [email protected] 2) Department of Measurement, , Faculty of Electrical Engineering and Information Technology, Slovak University of Technology, Ilkoviova 3, 812 19 Bratislava, Slovak Republic, tel.: +421 2 602 91 431, e-mail:[email protected] Summary: Self-calibration techniques could eliminate measurement errors caused by time changes and component aging. For ADC performance enhancement also averaging is necessary. In the paper the iterative measurement error correction method is presented in combination with averaging. Dither theory for Gaussian noise has been used for exhibition of averaging abilities in ADC characteristic improvement. Experimental ENOB value improvement is more than 1.5 bit. 1. INTRODUCTION Nowadays digital components form an important part of a measurement channel (MC) giving opportunity to wide range of signal processing techniques. Auto-calibration, auto-diagnostic and self-correction functions are implemented in modern measurement devices. It is often not difficult to make correction of offset and gain error of measurement transducer (MT). Correction of nonlinearities of the static transfer characteristic is then essential to enable further accuracy improvement. Sophisticated self-correction should be used for time changing nonlinearities. Analog-to-digital converter (ADC) could be used for direct voltage measurements but it is the basic part of a general digital measurement channel. It has the offset, gain and linearity error and methods for correction of ADC nonlinearities has been employed as discussed below. The nonlinear behavior of deviation between ideal and real ADC characteristics is connected with differential nonlinearity (DNL) or integral nonlinearity (INL) [1]. But the ideal characteristic is fundamentally nonlinear reflecting quantization error. ADC Single-chip microcomputer CPU Memory MUX PWM RCfilter I n p u t Averaging Iterative algorithm DAQ card Memory (Data File) + d s o s+d LabView USART d s o PC Matlab O u t p u t x m y S y k x y Fig. 1. Block diagram of the workplace. The iterative method of measurement accuracy improvement [2] could be used for correction of linearity error [3]. If implemented for ADC, its performance is limited by quantization error, because ADC is not sensitive to changes of the input value within the quantization step. The way to overcome this limitation is averaging of samples employing natural noise present in measured signal. In many cases intentionally added noise (dither) could help. If the noise is not subtracted from the signal after quantization in ADC (before averaging), it is called non-subtractive dither (ND). Block diagram in the Fig.1 shows the experimental system used for testing of iterative method with ND and averaging. Diagram of tested measurement unit (MU) is located in the lower side of the figure. It consists only of single-chip microcomputer (with some basic peripherals like power supply etc.) and low-pass RC-filter. The upper side is devoted to the main PC components used for testing and experiments. 2. ITERATIVE METHOD OF CORRECTION For the iterative method of measurement accuracy improvement four main blocks of the system are needed: - MT – represented by ADC in the Fig. 1 - Block of processing (BP) – CPU with memory in this case - Inverse element (IE) – PWM with RC-filter - Switch (SW) – multiplexer (MUX) The correction is realized iteratively in several steps. The BP controls the whole process. It receives input value from the MT and according to the implemented algorithm and data in the memory it calculates next input to the IE y s , while the formula for correction is [2], [3] ( ) [ ] ( ) 1,sIE0,1,s,s −− −+= isii yhhyyy (1) and initial value is y s,0 = h(x m ). With each step of iteration the y s,i should become more accurate representation of measured value x m . After appropriate number of steps when some ending condition is satisfied, the actual y s,i could be sent to the output of the MU as a result of correction. The
Iterrative correction of measurement with averaging of … 359 SW controlled by the BP permits to switch the input of ADC after initial step from measured signal x = x m to signal from output of the IE x = h IE (y s,i ). Just quality of IE determines achievable accuracy of corrected value and the aim is to have an ideal IE with inverse characteristics equal to ideal characteristics of MT h I (x) = h IE-1 (x). To present the theoretical functionality of correction with this algorithm, suppose the static characteristic of MT ( ) ( ) ( ) xhxhxh -1 IE += (2) (1) where h IE-1 (x) is the inverse static characteristics of IE and if it is ideal, then ∆h(x) is error characteristics. It could be shown, that the corrected value in step i is ( ) ( ) ( ) ( ) ( ) m m 1 IE m m 1 IEs, ' 'xh xh xh xhy i i −+= − − & (3) If for the ratio of derivations – sensitivity coefficients – in last equation quilts ( ) ( ) ( ) 1 ' ' m 1 IE m < − xh xh (4) then the algorithm converges to h IE-1 (x) because with each step i the weight of the error part in (3) decreases. The condition of convergence (4) is usually fulfilled for general transducer (not considering local instabilities of equation caused by quantization in ADC). But error of IE will occur in final value after correction. 3. GAUSSIAN NOISE AND AVERAGING The performance of iterative correction method is limited by resolution of AD conversion. Fortunately this resolution could be increased using averaging if there is an appropriate noise in the input signal [4]. Noise is present in real applications and usually it is of Gaussian nature, but its dispersion may be too small for obtaining good results. The mean error of noisy samples m ε |s is depending on measured signal s (q is quantization step) [4][5] ( ) ∞ = − − = 1 2 d 22 2 sin2exp 1 k k s q ks q k k qm πσ π π ε (5) and with increasing standard deviation (STD) σ d of noise (ND) d it goes to zero. This is presented in the Fig. 2 where dotted lines describe error without any added noise but black dotted line obtained from measurements has lower peak-to-peak amplitude thanks to natural noise. Gray lines are depicted according to theory (6) and black lines are from measurement as mean from 20 values obtained with averaging of N=59 samples. Averaging suppress noise but in the averaged data from final number of samples lowered noise is still present so it is not wished to have too lot of input noise but only some necessary portion for suppression of quantization error. Therefore there exists optimal noise STD [4]. In testing measurements several dithers with different variances (Fig. 3) were applied with the resolution of changes 1/16 LSB and the best value was chosen (it will be called quasi-optimal noise) for drawing the solid lines in the Fig. 2. The offset and gain error has been subtracted through the mean square straightline approximation. Deformation of measured curves could be influenced by DNL. 32 32.2 32.4 32.6 -0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04 measured value (%) error (%) Fig. 2. Mean error as a function of measured value in 8 LSB ADC input range. 0 0.002 0.004 0.006 0.008 0.01 0 1 2 3 4 5 6 7 8x 10 -4 noise variance (% ) 2 2 MSE (% ) Theory 8 LSB range measurements Whole range measurements Whole range measurements after correction Fig. 3. MSE dependency on variance of Gaussian dither. To find an optimal (or quasi-optimal) noise good parameter for rating of dithering and averaging performance is the mean-square error (MSE) theoretically evaluated for one whole quantization step µ a2 [4][6][7]. For Gaussian noise it holds ( ) 2 d 2 4 2 2 2 d d 2 a 2 1 1 12 , − −+ + = q e q NN q N σ π π σ σµ (6) The shift between theoretical and experimental MSE curve in the Fig. 3 is caused by natural noise present in the signal.
360 Advances in Electrical and Electronic Engineering 4. IE AND ASYNCHRONOUS SAMPLING Meaning of IE for ADC has digital-to-analog converter (DAC). Pulse width modulation (PWM) circuits are naturally precise but to get the mean of PWM output a PWM,0 and so to make DAC low-pass filter should be added after PWM. Simple RC-filter has been used with frequency characteristics for given time constant τ RC =RC ( ) 1 1 RCF + = ωτ ω RC j A (7) But the filter slows down the correction process because after every step the process should wait until settling of filter output. Faster filter could be substituted, if averaging of N samples is used also inside the iterative correction process, i.e. there is digital filter after the analog one. Output of RC-filter could then oscillate in several LSB and through sampling and averaging accurate mean might still be evaluated. The best way is to use synchronous sampling here but there may be no possibility to synchronize independent circuits. Asynchronous sampling gets samples from general rectangular window N.T s wide (T s is sampling period) with frequency characteristic ( ) 0 0 22 RW s 1,samp s ,sam ≠ − = = −− −− ω ω ω ω ωω T tj T tj s ee j NT A Np (8) t samp,1 and t samp,N is sampling time of first and last sample. The mean after the RC-filter and rectangular window, if ω RW = 2 π /N.T s and ω PWM = 2 π /T PWM , T PWM is period of PWM output, is (according to theory described in [8]) ( ) ( ) PWMRWPWMRCF0,PWM RW 0,IERW 1 ωω nAnAa T a n −= ∞ −∞= (9) Fig. 4. Theoretical error of mean from windowed DAC output. The Fig. 4 exposes theoretical error of mean evaluation after windowing for the sampling frequency and period of PWM output used in experiments. This nonlinear error could be seen as a component of IE static transfer characteristics and is unwanted for linearity error correction. In the Fig. 4 the areas close to zero error correspond to quasisynchronous sampling, when the error of getting integer period number of sampled signal is less than T s . In the next Fig. 5 quasi-synchronous cases of N are outlined. To make the error negligible maximum should be deeply under 1 LSB of ADC, while for the used 10-bit ADC the error of 0,098 % responds to 1 LSB. N=39 looks still not enough, it could be improved by shifting the start of sampling in several T s multiples but in the case of N=59 the error is sufficiently low relative to the nominal resolution of ADC or to achievable MSE after dithering and also to error of analog IE discussed in the next section. 0 20 40 60 80 100 -0.02 -0.01 0 0.01 0.02 0.03 ideal mean (%) error (%) N=20 N=39 N=39, shifted N=59 Fig. 5. Theoretical error of mean from windowed DAC output for quasi-synchronous windows – black lines is theory, gray line is from simulations of quasi-synchronous sampling. 5. EXPERIMENTS AND DISCUSSION As shown in the Fig. 3, natural noise shifted the MSE curve horizontally in comparison to the theory leading to less optimal dither variation in experiments while INL shifted the curve up. 0 20 40 60 80 100 -0.1 -0.05 0 0.05 0.1 measured value (%) error (%) + LSB - LSB gray dotted line - without correction and averaging black dotted line - without correction but with dither and averaging gray solid line - with correction and averaging but without dither black solid line - with correction, dither and averaging dark gray bold line - measured IE nonlinearity Fig. 6. Mean error from 20 processes in 51 points spread through the whole input range. In the Fig. 6 the mean error after correction for the best Gaussian dither is depicted as dark black solid line. Improvement against the results without
Iterrative correction of measurement with averaging of … 361 averaging and without iterative correction is evident. Limitation here is nonlinearity of analog IE. In the Fig. 7 minimal and maximal error values from 20 processes are exposed. 0 20 40 60 80 100 -0.1 -0.05 0 0.05 0.1 measured value (%) error (%) - LSB + LSB gray dots - without correction and averaging black dotted lines - without correction but with dither and averaging black solid line - with correction, dither and averaging dark gray bold line - measured IE nonlinearity Fig. 7. Minimum and maximum error from 20 processes in 51 points spread through the whole input range. For the method performance evaluation the equivalent number of bits (ENOB) could be used. 20 processes in each of 51 points equally spread through the whole input range could be regarded as 20 periods of sawtooth testing signal, for which the ENOB could be calculated (SNR is signal to noise ration) as 2log20 12 2 log10 2log20 10 2 a 2 10 10 µ B SNR ENOB == (10) The ENOB curves are shown in the Fig. 8. In practical devices offset and gain error is usually compensated through the end-point straight line, therefore the selected best ENOB value is also recalculated in this way in the figure. 0 0.05 0.1 0.15 0.2 9.5 10 10.5 11 11.5 12 noise STD (%) ENOB (bit) 8 LSB range measurements Theory Whole range measurements with correction Whole range measurements without correction The best point from whole range measurements Shifted best point of whole range measurements if end-point straight line aproximaton used for offset and gain error correction Without correction and averaging Without correction and averaging, end-point straight line used for offset and gain error correction Fig. 8 ENOB characteristics. 6. CONCLUSION Iterative correction of linearity error has been implemented in measurement unit. Averaging enables correction under 1 LSB of used 10-bit ADC and analysis of quasi-synchronous sampling of periodic signal set the minimal suitable value of averaged data to N=59. But natural noise in real signal is usually less than optimal and theoretical behavior of accuracy (MSE) dependence from STD of added noise (non-subtractive dither) has been proved through measurements in 8 LSB range. For the whole input range after offset and gain error correction through linear regression the total root mean square error (RMSE) decreased from 0.0402 % to 0.0120 % and adequately ENOB grown from 9.488 bit to 11.231. If end-point straight line offset and gain error correction applied for chosen quasioptimal noise, the improvement was from 0.0446 % to 0.0155 % in RMSE and from 9.400 bit to 10.859 bit in ENOB. Acknowledgement Work presented in this paper was supported by the Slovak Ministry of Education under grant No. 2003SP200280802 and by the Slovak Grant Agency VEGA under grant No. 1/3101/06 . REFERENCES [1] Michaeli, L.: Modelovanie analógovo- íslicových rozhraní. FEI TU Košice, 2001. [2] Muravyov, S. V.: Model of procedure for measurement result correction. Proceedings of the XVI IMEKO World Congress. Vienna, Austria, published on CD, 2000. [3] Kamenský, M., Ková , K.: Sensor Nonlinearity Error orrection by Algorithmic Technique. Radioelektronika. Conference Procedings: 16th International Czech - Slovak Scientific Conference. Bratislava, Slovak Republic. 2006. [4] Skartlien, R., Øyehaug, L.: Quantization error and Resolution in Ensemble Averaged Data with Noise. IEEE Transactions on Instrumentation and Measurement, No.3, Vol.54/2005, pp. 1303-1312. [5] Carbone, P., Petri, D.: Effect of Additive Dither on the Resolution of Ideal Quantizers. IEEE Transactions on Instrumentation and Measurement, No.3, Vol.43/1994, pp. 389-396. [6] Carbone, P.: Quantitative Criteria for Design of Dither-Based Quantizing Systems. IEEE Transactions on Instrumentation and Measurement, No.3, Vol.46/1997, pp. 656-659. [7] Kamenský, M., Ková , K., Králiková, E., Krammer, A.: Evaluation of Measurement Performance in Averaging Quantization System with Noise. Radioengineering, No. 4, Vol. 16/2007, pp.114-119. [8] Uhlí , J., Sovka, P.: íslicové spracování signál . VUT, Praha, 1995.