Uncertainty evaluation on the absolute phase error of digitizers

In many engineering applications the phase angle of a signal is a key parameter. Especially when measuring small angles, the measurement accuracy is of a vital importance. Often, the absolute phase error of a digitizer, which is defined as the phase displacement between the digitized output and the input analog waveform and which represents a systematic measurement error, is neglected. Therefore, in this paper, a new measurement technique for the evaluation of this absolute phase error is discussed, along with a deep theoretical analysis on the uncertainty sources and how to handle them. The measurement technique is validated through a high accuracy experimental setup. Experimental tests demonstrate that even high accuracy digitizers can show non-linear behavior in the absolute phase errors.


Introduction
The signal phase angle is an important information required in a lot of engineering applications, from telecommunications to power systems (Pawula et al., 1982;Phadke, 1993). Most of the modern electronic instruments that perform accurate measurement of this quantity are based on data acquisition systems, namely digitizers. The digital samples are then used by a measurement algorithm that returns the measurement. However, it must be accounted that every digitizer has its own phase frequency response, which introduces a systematic phase deviation between the analog input and its corresponding digital output samples. This deviation can be defined as the absolute phase error of the digitizer and it depends on the characteristics of the digitizer input circuitry and on the digitalization architecture. In applications with low frequency signals, this phase deviation can be considered negligible; in particular, when the phase displacement reflects into a time delay very short with respect to the time period of the considered signals. In addition, for those measurements, in which only the relative phase delay between signals is important (f.i. power, energy, impedance measurement, etc.), this effect reduces its impact because phase subtraction leads to the compensation this systematic effect. Nevertheless, the issues related with measurement of the relative phase delay between two channels of the same digitizer, or two channels of two different digitizers with synchronized sampling clocks, are faced in a number of scientific papers (Bosco et al., 2011;Crotti et al., 2017;Trinchera et al., 2017).
However, there are issues in special applications not yet addressed in scientific literature, such as the measurement of the phase angles timestamped against the absolute timeused, for example, for Phasor Measurement Unit (PMU) -in medium voltage grid application (Braun et al., 2016;Georgakopoulos and Quigg, 2017;Luiso et al., 2018;Sa´nchez-Ayala et al., 2013;Tang et al., 2013), or as the phase difference measurement with accuracy of the microradian; necessary, for example, for the calibration of Low Power Instrument Transformers (LPIT) with digital output (DLPIT) or Stand Alone Merging Units (SAMU) (Collin et al., 2018;Crotti et al., 2018aCrotti et al., , 2018bDel Prete et al., 2018;Djokic and So, 2005;Houtzager et al., 2016;Juvik, 2000;Mohns et al., 2017), carried out by comparison with a reference device with analog output -where the absolute phase deviation of the single channel of the used digitizer may be comparable or higher than the required accuracy.
In Crotti et al. (2019), the same authors presented a measurement procedure for the evaluation of the absolute phase errors of a digitizer, with an experimental validation. Here, the attention will be focused on aspects not fully addressed by Crotti et al. (2019). In particular, this paper will deepen the metrological characterization, explaining in details the evaluation of the uncertainty contributions, especially that due to the non-linearity of the comparator shown in Crotti et al. (2019). Moreover, in Crotti et al. (2019), only the dependence of the absolute phase error on signal frequency and sampling frequency was shown, whereas, here, also the dependence on the signal amplitude and on the temperature are shown. The structure of the paper is as follows. Section 2 presents the measurement technique and Section 3 discusses the implementation of the experimental setup. In Section 4, a deep theoretical analysis of the uncertainty sources and how to evaluate them is shown. Section 5 describes the experimental tests on a high accuracy digitizer and, finally, Section 6 draws the conclusions.

Measurement method
In order to evaluate the absolute phase error of a digitizer, a phase delay between a digital quantity, composed by the output samples of the digitizer, and an analog quantity (very often it is a voltage), which is the digitized signal, must be evaluated . To the best of the authors' knowledge, direct measurement methods able to quantify this phase error are not available. Therefore, the authors propose an indirect measurement method, which has been fully described in Crotti et al. (2019); here, it is only briefly summarized. It is based on the introduction of a Phase Reference Signal (PRS), that is a square wave, having the same frequency of the input signal. The digitizer to be characterized (Digitizer Under Test, DUT) is supplied with a sinusoidal signal s g generated by an Arbitrary Waveform Generator (AWG), that also provides a signal that acts as the PRS (see Figure 1). Assuming the rising edge of the PRS as the time reference (t = 0), the initial phase of the generated sine wave should be zero; however, due to phase frequency response of the AWG and its internal time delay, the sine wave is delayed of a phase u g . Thus, the DUT input can be written as where f 0 is the signal frequency and, for sake of simplicity, a unitary amplitude is considered. Let us consider now the DUT sampling clock; the PRS is used as trigger to start the sampling clock. In the ideal case, the first sampling command is coincident with the rising edge of the PRS; however, since there could be a propagation delay in the clock paths, in actual cases it has a time delay equal to t c , as shown in Figure 1. Instead, under the hypothesis of short term stability of the sampling clock, choosing a sampling period T s results in equally spaced sampling commands and so the k th sampling command is delayed of the quantity kT s + t c . The delay t c latter must be taken into account and not be confused with the phase error of the DUT. There is also another phenomenon to be considered, that is, the delay between the DUT sampling command and the actual sample acquisition (samples obtained with instantaneous sampling, represented as the circle in Figure (1); of course, the acquisition is not instantaneous and the actual samples are delayed (crosses in Figure (1)). The phase shift due to this time delay is the quantity of interest, that is, the absolute phase error of the digitizer and it is due to two contributions: the phase shift introduced by the analog input circuitry (see generated and delayed waveform in Figure (1)) and the further internal delay on the sample command that is the time needed by the digital circuits to sample the input signal (see sampling command and acquired command in Figure (1)).
Therefore, the samples at the output of the DUT can be expressed as where u DUT f 0 ð Þ is the phase deviation introduced by the DUT at frequency f 0 (the gain deviation has been neglected) and u TOT is the phase angle of the samples of the DUT.
The quantity u g f 0 ð Þ can be measured with a phase comparator (COMP) (Crotti et al., 2017;Trinchera et al., 2017) and the quantity t c can be measured with a frequency counter. The phase angle, u TOT , of the DUT samples, at frequency f 0 , can be evaluated by performing the Discrete Fourier Transform (DFT) and expressed as ]F s DUT kT s ð Þ ½ j f0 ; thus, the DUT phase error, at frequency f 0 , can be calculated as Usually, a COMP is used to measure the phase shift between two sinusoidal signals. Instead, the quantity u g f 0 ð Þ is the phase shift among the input sinusoidal signal and the PRS, which is a square wave. For an ideal square wave, the fundamental component presents the zero crossing with positive slope in correspondence of the rising edge of the square wave. Therefore, in order to get the quantity u g , a convenient solution is represented by the extraction of the PRS fundamental spectral tone and the successive comparison of its phase angle with that of the sine wave s g t ð Þ: Since these two signals (the sine wave and the PRS) are stationary, the execution of the DFT on the two signals allows for the measurement, in the frequency domain, of the desired phase delay. Possible measurement errors could arise from the effect of the use of a finite sample rate to measure the spectral content of the square wave (namely the aliasing), which presents an infinite frequency spectrum. An analog antialiasing filter, applied to the square wave, can solve the problem, but introduce other issues, like offsets, non-linearity, temperature drifts, and so forth. Therefore, in order to overcome this issue, the oversampling technique here along with a digital antialiasing filter and a sampling decimation has been used. This filter is integrated in the COMP and it is executed both on sine wave as well as on PRS.
Thus, if the sampling frequency has a value higher (here the minimum sampling frequency used is ten times greater) than the frequency of the PRS, the aliasing issue is solved and, since the Nyquist theorem is respected, we can accurately measure the PRS fundamental phase angle.

Measurement setup
A high accuracy measurement setup, shown in Figure 2, has been built in order to give an experimental validation to the proposed technique. A NI PXI (National Instruments PCI eXtension for Instrumentation) platform is at the base of the setup, which makes use also of a GPS-disciplined Rubidium atomic clock (Fluke 910R) and the external universal frequency counter Agilent 53230A (350 MHz, 20 ps). The multifunction I/O module NI PXIe-6124 (6 10 V, 16 bit, maximum sampling rate of 4 MHz) has been used as DUT. The module NI PXI-5422 (6 12 V, programmable gain, 16 bit, maximum sampling rate of 200 MHz) has been used as AWG.
The digitizer used as phase comparator (COMP) is, instead, the module NI PXI 4462 (6 10 V, 24 bit, maximum sampling rate of 204.8 kHz). All the instruments of the test bench operate synchronously, since the clock source from the Fluke 910R is provided to the whole PXI backplane and to the frequency counter as external timebase. Clock signals (with frequency different from 10 MHz) and trigger signals are generated by the NI PXI-6683H synchronization board.
In particular, the sampling frequency of the AWG is 5 MHz, while the sampling clock of the DUT is made variable up to 1 MHz. The PRS is generated by the NI PXI-6683H, too. A digital storage oscilloscope (Tektronix TDS 2014B) is only used to control the correct operation of the setup and it is not involved in the measurement of the absolute phase error. The signal C DUT is the DUT sampling clock and the signal C AWG is the sampling clock of the AWG. The sine wave is connected to both the DUT and the COMP. The COMP measures the phase difference between the sine wave and the PRS. The frequency counter receives a 10 MHz clock as external timebase and measures the time delay between the PRS and the DUT sampling clock.
All the clock and signal paths are symmetric in order to avoid different propagation delays. Since the two input channels of COMP and of the counter could have inter-channel time (or phase) delay, in order to compensate for these systematic errors, two measurements are performed, interchanging the signals between the two channels, both for the COMP and the counter (Crotti et al., 2017(Crotti et al., , 2019Trinchera et al., 2017).
Measurement software is developed in LabVIEW. For each test point, amplitude and frequency of the test signal of the DUT can be chosen and 30 repeated measurements of ]F s DUT kT s ð Þ ½ j f0 , t c and u g f 0 ð Þ are performed.

Uncertainty evaluation
As follows from the equation (3), the absolute phase error of the DUT is obtained by combining three different quantities: the phase angle of the samples acquired by the DUT, u T , the phase delay between the PRS and the DUT sampling clock, u c , and the phase angle of the generated signal referred to PRS, u g . Therefore, in order to evaluate the uncertainty on the measurement of u DUT , in the following, each of these terms will be analyzed to point out the uncertainty contributions. In addition to these main contributions, the repeatability and stability of the measurement setup should be accounted too.
It is possible to identify three sources of uncertainty in measurement: (1) the uncertainty on the phase due to comparator non-linearity uu g , (2) the uncertainty on clock delay uu c and (3) the uncertainty on sampling event uu T .
Let us consider now, in more detail, the causes of those uncertainty contribution and how they have been evaluated.
As explained in Section 2, the phase angle of the generated sine wave, with respect to the PRS that defines the reference time instant (t = 0), is evaluated by means of the COMP, which measures the relative phase deviation between the sine wave and the fundamental component of the PRS. Therefore, the two input channels of the COMP are stimulated with waveforms with different characteristics, namely, a sine wave and a square wave. In particular, the square wave could stimulate a residual non-linear behavior of the channel, which is not stimulated by the sine wave. This aspect must be taken into account in the uncertainty evaluation.
Generally speaking, the comparator introduces a systematic phase error when measuring the relative phase between the two signals due to different time delays of its internal paths. This systematic error can easily be highlighted by supplying the same signal to both inputs (Channel 1 and Channel 2) through symmetrical paths. In this situation, the measured phase delay should be theoretically exactly zero, so a measured value different form zero is due to the systematic error introduced by the comparator that can be modelled with a differential phase displacement. This effect can be compensated in a simple way when input signals are sinusoidal. In fact, considering two sinusoidal signals (WaveA and WaveB) at the same frequency, with a relative phase delay of Du d , and connecting WaveA at Channel 1 and WaveB at the Channel 2, the measured phase delay, Du m1 , can be expressed as where Du 1 and Du 2 are phase displacements at the frequency of the two sinusoidal signals due to Channel 1 and Channel 2, respectively, and Du 12 is the resulting systematic error introduced by the comparator on relative phase measurements. So, the measurement result is the combination of the systematic error of the comparator with the actual phase displacement, Du d . Nevertheless, this systematic error can be compensated, inverting the waveform connection at comparator inputs (WaveB is connected to Channel 1 and WaveB at Channel 2) and measuring again the phase displacement. With this configuration, the phase delay between the signal is changed in sign, instead the systematic error remains the same so the second measurement of the phase displacement, Du m2 , results Now, the correct value of the phase displacement can be easily obtained with equation (6) Du This kind of analysis should be conducted even when input waveforms are not sinusoidal and even different (i.e. sinusoid and square wave as in the considered application). In fact, we have already pointed out that the comparator can be used to evaluate the phase displacement between the fundamental components for those signals for which the zero crossing (or rising edge) of the waveform is coincident with the zero crossing of the fundamental component (like for square wave). Under the hypothesis of two perfect input channels (perfect linear behavior and ideal frequency response without attenuation/amplification and phase modifications in the frequency range of interest) the presence of harmonic does not affect the measurement and the correction can be performed as in equation (6). On the contrary, in real cases, the correction is not so simple. In fact, the non-ideal frequency response introduces modifications in amplitudes and phases of the harmonics components and these reflect in the modification of the zero crossing and thus of the phase of the fundamental component. In addition, an eventual non-linear behavior even changes the shape of the waveform. Both the phenomena, obviously, affect the measurement of the phase displacement introducing a further systematic deviation. In this situation, the relations for the results obtained with the two measurements, performed by inverting the input waveforms -that is, equations (3) and (4) -can be rewritten as where two additional systematic deviations, Du 1, NL and Du 2, NL , due to the non-sinusoidal waveforms considered, are added. In this case, the two contributions should be in general considered different because they depend on the input waveforms and on the different input channel characteristics. It is apparent that the more complex is the input waveform (i.e. the greater is the number of harmonics that must be considered) the more difficult is the evaluation of the nonlinearity contribution to the systematic error. In this situation, the average of the measured values obtained by inverting the signals at the inputs of the comparator becomes so, generally speaking, the deviation due to non-linearity cannot be exactly eliminated. Nevertheless, as the circuits of the comparator inputs are built in identical way, under the hypothesis of identical waveforms (in amplitude and shape) the two contributions can be reasonably expected to be identical or at least very similar. Therefore, with the averaging, it is possible to expect a cancellation of these contributions or at least a great reduction of their impact in the results, so that they can be neglected and even in this case the average of the two measurements leads to a correct measurement result This assumption is not straightforward for the considered application, because the two waveforms are very different (a sine wave and a square wave) and with different amplitudes, so that further considerations are necessary. First of all, it is important to underline that the on-board anti-aliasing filter, which removes all the harmonic components above Nyquist frequency, produces a smoothing in the square wave shape, so reducing the non-linear phenomena. At first, some analyses to quantify the amount of difference in non-linearity of the two considered channels were performed. To this aim, the two input channels were supplied with the same signal trough symmetrical path and two types of waveform were considered: a pure sinusoidal signal and a square wave (see Figure 3). In both the situations, the input waveforms were synchronously acquired from the two channels and the spectra of the acquired signal were analyzed by measuring the difference between the corresponding tones of the two spectra. The comparison was performed only for the harmonic components with magnitudes above the noise floor. These analyses were continuously performed for a period of time of about 10 hours, in order to account also for warming effects. The maximum measured difference was obtained with square wave and this value normalized with respect to the amplitude of the signal was equal to 0.3 mV/V. This low value show that the non-linear behavior of the considered acquisition channels are almost equal.
Then, in order to evaluate the residual uncertainty associated with this cancellation, we measured the systematic error introduced by the comparator in different conditions: (1) Du SQ , with two square waves with equal amplitudes, equal to 3.3 V; 2) Du S, 1 , Du S, 2 , Du S, 5 , Du S, 10 , with two sinewaves with the same amplitudes, equal to 1 V, 2 V, 5 V and 10 V (the same amplitudes at which the DUT absolute phase error has been measured).
Then, the standard uncertainty related to the non-linearity cancellation has been estimated as follows where the subscript X represents the standard uncertainty when the amplitude of the sinewave is X volt.
In practice, we assumed that the maximum phase error due to the non-linearity of the comparator is the difference between the systematic phase errors measured when at the inputs there are two square waves and two sinewaves. Then, assuming a uniform probability distribution, the standard deviation is taken as the standard uncertainty. For each frequency, the maximum uncertainty value, among all the tested sinewave amplitudes, has been taken as uncertainty due to non-linearity.
It is worth underlining that the proper uncertainty evaluation is proven by the comparison of the proposed method with other classical method, shown in Crotti et al. (2019): the results are always compatible.
The second contribution to the uncertainty comes from the measurement of the time delay between DUT sampling clock and the PRS by means of the frequency counter. The uncertainty uu c in measurement of this parameter is due to the finite slew rate of the electronic devices that generates the two considered signals; it prevents having an instantaneous change between the logical levels (low and high) and thus an exact definition of time instants. The considered signals, in fact, when the transition should apply, change their amplitude almost linearly from the initial value to the final value (see Figure 4), taking a certain time to complete the commutation. The parameter that characterizes the quality of the commutation is the rise time and it is defined as the time needed for the signal to rise from the 10% to the 90% of the final value. Therefore, if we measure this rise time, we can evaluate the uncertainty on the quantity 2pf 0 t c , as where f is the frequency of input sine wave and Dt is the rise time shown in Figure 4. The estimated uncertainty contribution due to the PRS rise time is lower than 0.2 mrad at 50 Hz and 68 mrad at 20 kHz. The actual time instant in which the DUT, after the recognition of a pulse of the sampling clock, performs the sampling, represents another source of uncertainty. The sampling command is recognized by the DUT at a level of 2.2 V, with positive slope, of the sampling clock. Thus, we can consider that, since the sampling clock (due to the finite analog bandwidth of the digital circuitry) has a rising edge that is not vertical and the DUT does not recognizes the level of 2.2 V in a perfect way, from these two effects an uncertainty contribution arises. With the frequency counter we measured the time interval between the time instants in which the sampling clock crosses the levels of 2.1 V and 2.3 V (Dt in Figure 5). Its uncertainty contribution has been quantified, with an equation similar to (11), to be lower than 10 nrad at 50 Hz and 4 mrad at 20 kHz.
All the standard uncertainty contributions, at 50 Hz and 20 kHz, are shown in Table 1.

Experimental results
This section will refer to the relative phase error measurement method, illustrated in Trinchera et al. (2017) and Crotti et al.,   2017), as COMP method. In this section, further experimental results with respect to Crotti et al. (2019) are presented. Various experimental tests have been performed on the DUT. The used input signals had four amplitudes, 1 V, 2 V, 5 V, 10 V (these values correspond to the four full scale ranges of the DUT) and various frequencies between 1 Hz to 20 kHz. The sampling frequency was kept constant at 1 MHz for this set of tests. Then, the signal frequency was kept constant to 50 Hz and the sampling frequency was varied in the range between 1 kHz and 1 MHz. The absolute phase errors of two channels of the DUT (CH0 and CH1) were measured.
From the measurement of the absolute errors of the two DUT channels, their relative phase error is obtained by computing the difference. In this way, it is possible to compare the obtained results with those of the more conventional COMP method on the same two channels. Some results have been already shown in Crotti et al. (2019); further results are shown in Figures 6-8. Figure 6(a) shows the absolute error of CH0 of the DUT; it has been obtained with 2 V input signal amplitude, in the frequency range from 1 Hz to 20 kHz, with constant sampling frequency of 1 MHz. Figure 6(b) shows, instead, the relative phase error between CH0 and CH1 of the DUT, evaluated by  Figure 6. (a) CH0 absolute phase error at 2 V with constant sampling frequency, (b) relative phase errors between CH0 and CH1, obtained with two different methods.
computing the difference among the absolute phase errors (solid line) and by performing the COMP method (dashed line). The error bars represent the expanded uncertainty (level of confidence of 95 %). It is worthwhile noting that the results are always compatible and so in good agreement. Another phenomenon to be observed is the dependence of the absolute phase error of the DUT channels on the input signal amplitude, which implies a non-linear behavior of the channel. This phenomenon is shown in Figure 7(a), which depicts the absolute phase error of CH0 when the input signal frequency is 50 Hz and the sampling frequency is 1 MHz. Moreover, Figure 7(b) shows the relative phase error between CH0 and CH1 of the DUT, evaluated by computing the difference among the absolute phase errors (solid line) and by performing the COMP method (dashed line). The error bars represent the expanded uncertainty (level of confidence of 95 %). Unlike the absolute phase error, the relative phase error between the channels is practically independent from the input signal amplitude: this means that, even each channel has a non-linear behavior (the absolute phase error depends on the input amplitude), the two non-linear behaviours are approximately the same and thus they disappear when the relative phase error is evaluated.
The same quantities shown in Figure 7(a) and Figure 7(b) are shown also in Figure 8(a) and Figure 8(b) but with input signal frequency equal to 20 kHz. Looking at Figure 8(a), we can see that the non-linear behavior of the absolute phase error, already observed in Figure 7(a), is now amplified. Moreover, in Figure 8(b) we can observe also that the relative phase error now shows a non-linear behavior, despite it is not being observed at 50 Hz (Figure 7(b)).
A final consideration is about the temperature dependency of the absolute phase error. It is worth noting that all the experimental tests have been performed in the following way. First of all, the DUT has been warmed up, setting operating condition as near as possible to the test conditions, monitoring the temperature of all the instrumentation involved and in particular that of the DUT. Then, multiple subsequent measurements were conducted for each test verifying that first and last measurement results still agrees within the uncertainty bound. It means, of course, that the measurand is not changed significantly during the tests. This is easily achieved when the thermal regimen is reached and the temperature is almost constant. This approach allows avoiding a further uncertainty contribution due to measurement instrumentation temperature. All the results obtained without following this procedure presented high variability and also the comparison with the COMP method did not always show compatible results.
In order to highlight this phenomenon, a dependence of the CH0 absolute phase error on the DUT temperature is shown in Figure 9, where the input signal has an amplitude of 5 V and frequency of 20 kHz and the DUT has a sampling frequency of 1 MHz. All the temperature measurements are performed by using the internal temperature sensor of the digitizer. Even if the values of the absolute phase errors measured at very near temperatures (less than 1 K) are compatible within the measurement uncertainty (the bars show the level of confidence equal to 95%), it is possible to observe a variation of the absolute phase error with the temperature. However, further investigation on the temperature dependency of the DUT absolute phase error is still in progress.

Conclusion
This paper deepens the evaluation of the uncertainty in the measurement of the absolute phase error of a digitizer. This method has been already presented by Crotti et al. (2019) and here it is briefly reviewed. Particular attention has been devoted to the theoretical analysis of the compensation of the systematic errors present in the measurement method and to the uncertainty contributions due to such compensations. The method for the estimation of the non-linearity of the used phase comparator has been presented.
New conclusions have been drawn about the absolute phase error of a digitizer: even high accuracy digitizers can suffer from non-linear behavior regarding the absolute phase error and, moreover, different channels of the same digitizer can have different non-linear behaviors in such a way that also the relative phase error between these channels can have non-linear behavior.
Another aspect that is highlighted in this paper is the temperature dependence of the absolute phase error: in order to avoid the temperature contribution to the total measurement uncertainty, a specific test method is proposed. Further investigations about the temperature dependence are still in progress.

Declaration of conflicting interests
The author(s) declared no potential conflict of interests with respect to the research, authorship and/or publication of this article.