Time Domain Distortion Estimation and Correction Using Sample Shifting Procedure

A new method is presented to estimate and compensate sampling instrument’s time base distortion. Method requires periodic test signal. Presented method also provides an algorithm to eliminate time base distortion. Evaluation and correction process is described and illustrated using real acquired test signal. Correction improvement is verified using signal amplitude spectrum comparison. DOI: http://dx.doi.org/10.5755/j01.eee.19.9.5654


I. INTRODUCTION
Sampling oscilloscope principles are commonly used for high frequency and Ultra wideband signal conversion to lower frequency band.Down conversion process may suffer from systematic time base distortion and random jitter that also cause sampling errors.There are many methods how to fight time base errors by improving convertor's hardware, using additional mathematical correction algorithms or using combination of both.In this paper time base errors are eliminated using only mathematical methods.
A new method is proposed for systematic time base distortion estimation and correction.Time domain error is evaluated from distorted periodic test signal.It is possible to use any arbitrary periodic signal as test signal.Time base distortion estimation is possible from any acquired signal if the signal of interest has periodic characteristics (as it is for Ultra wideband signals) and test signal may not be required.Estimation is done by analysing how periodic test signal's each period is affected from systematic time based distortion.
After time base distortion estimation, correction for the signal is possible.Each sampled point is shifted accordingly to compensate time based distortion.Afterwards discrete Fourier transformation is used and signal's amplitude spectrum is evaluated to determine if correction is accurate.Since periodic test signal is used, it is expected that spectrum consists only of test signals main frequency and its higher harmonics.Any other spectrum components are considered as time base distortion caused errors.
In this paper we assume that systematic error is much greater that random jitter caused error and jitter can be ignored.

II. RELATED WORK
In [1] sinewave fit method is combined with the time base distortion measurement technique from [2] in order to identify harmonics of a periodic signal in presence of measurement noise, systematic and jitter caused time base errors to measure quality of data acquisition channel.Since systematic time base errors results new frequency components not being present in the excitation signal it is necessary to eliminate systematic time base error.In this paper signal's amplitude spectrum estimation is used afterwards to determine whether time base distortion is compensated correctly.For more information about sinewave fitting algorithms it is advised to read [1] and [2].Similar solution using iterated sine-fit algorithm is discussed in [3].
Time base distortion and jitter caused errors can also be corrected if signal of interest is measured simultaneously with two reference sinusoidal signals [4].Author proposes to use two sinusoids that are in quadrature and phase locked to the signal of interest that serve to determine the actual time at which the measurement was performed.The new time base is estimated from the sinusoids using a weighted "error-in-variables" approach that accounts for relative contributions of additive noise and timing error.Author proposed method requires additional two reference signals that have to be precisely synchronised in respect to input signal.If systematic time base error in measured signal is dominant then we propose to estimate systematic time base error from test signal and use it to make corrections for the signal of interest.For more information about mentioned methods it is advised to read [5] and [6].

III. TIME BASED DISTORTION ESTIMATION
In this paper a new method for time based distortion estimation is introduced.Method requires any shape periodic signal with period length that is significantly less than systematic time base errors repetition time.For further reference it is assumed that systematic errors period is equal to acquired signal length.An example of test signal that is used for error estimation is illustrated in Fig 1 .Analysing recorded test signal after time based distortion, it is possible to estimate distortion from affected test signal periods.
In order to estimate distortion it is necessary to measure acquired signal periods.Period lengths should be equal for undistorted signal, but for distorted signal period lengths varies.To make sure if test signal fits for further use, undistorted signals distortion is estimated.First step is to measure period lengths for test signal.Period lengths can be measured as distance between signal peaks or another approach is to calculate signal level crossing points and measure period length between acquired points.For accurate results period measuring between signal peaks is not suitable, because we have limited number of points on the peak.To avoid inaccurate measurements we choose period measurements between level crossing points.
To increase accuracy, level crossing points is calculated using linear interpolation between two closest points which are respectively above and below crossing level.
Crossing points are calculated from two measured points  1 which is measured at  1 and  2 which measured at  1 + Δ.Crossing level   stands between both points  1 and  2 .Using line equation we can then calculate precise crossing point from (1) or (2): When crossing points are calculated it is possible to calculate all period lengths.From acquired period lengths period standard deviation is calculated and divided with period mean value (3) to evaluate period length distribution Now ( 3) is used to make sure if test signal is valid for further usage.It should be noted that test signal is acquired with real time oscilloscope.Calculated period length distribution for acquired test signal is 0.0383 %.Based on obtained value we can assume that the test signal is valid.
We use same period estimation for distorted signal.For distorted signal Fig. 2 we have to calculate level crossing points.Crossing level can be of any value, but for current signal it is chosen 0 to increase accuracy since the signal has the highest ascent there.Same as before, level crossing points are calculated using linear interpolation between closest points to respective level.Zero crossing points are marked with red circles in Fig. 2. Note that signal is amplified and suffered from frequency bandwidth reduction during down conversion and acquisition.Amplitude and frequency bandwidth does not affect time base distortions and can be ignored.
It is known that signal has suffered from time based distortion.Calculating period lengths and estimating period deviation we can observe significant period length scattering.After calculations we get 5.461 % period length distribution.To observe period lengths it is possible to plot them in Fig. 3.As we can see in Fig. 3 period lengths vary between 70 and 82 points.It is also important to note that period lengths have particular pattern and it is the same as time domain systematic error.After many observations it is possible to conclude that time jitter error is considerably lower than systematic time base distortion error.Therefore previously mentioned assumption about time jitter insignificance in time domain distortion is confirmed.

IV. CORRECTION
In previous section it was concluded that ideally test signal periods must be equal and invariable over sampled signal length.At the presence of time base distortion sampled signal varies over time and test signal periods vary as well.Now it is possible to use level crossing which were used for period length calculations to make corrections to First it is necessary to draw attention of how level crossing points are scattered over time in Fig. 4. In order to eliminate time base error, one has to make sure that crossing points lay on a straight line.From Fig. 4 information about signal level crossing point real values can be acquired.It is known where calculated signal crossing points are, and it is also known where they should cross respective level, if we assume that ideal period length is equal to calculated periods length average value.
To get undistorted signal crossing points it is necessary to calculate acquired period length average value and plot line with ascent equal to this value.If undistorted signal level crossing points are subtracted from acquired signal level crossing point values then we get values that show how much distorted signal crossing point has drifted from its original position.
Crossing point line in Fig. 4 shows time distortion characteristics over acquired signal.In order to make corrections it is necessary to interpolate distorted signal at calculated level crossing points.Now, if interpolated signal is plotted with constant step signal may be considered corrected.Correction for first two level crossing points is illustrated in Fig. 5. Following the instructions it is possible to correct only signal level crossing points.In order to make corrections for entire signal it is necessary to perform interpolation over all signal length not just crossing points.When interpolating level crossing point graph it is possible to acquire additional points between level crossing points on the signal.Performing distorted signals interpolation at acquired points and level crossing points, it is possible to make corrections for entire signal.After interpolation, signal has to be plotted with constant sample step in order to make corrections.
If signal is plotted as a function depending from varying steps at values that are the same as calculated crossing points, then it will result in exact same time distorted signal as distorted test signal.Only if sampling frequency is chosen constant, corrected signal without time domain distortion is obtained.Since interpolation on test signal was done using variable sampling step dependent of time base distortion, interpolated signal plotted with constant sampling step is corrected test signal.
Depending from constant step length signal's main frequency may vary.To avoid frequency floating it is advised to calculate constant step length before correction.To do that step length can be either calculated from input signal frequency analysis or either from exact test signal frequency and converters sampling frequency.
Correction can be done only between level crossing points since no information about the time distortion can be acquired before first and after last crossing point.Difference between corrected signal and originally acquired signal is illustrated in Fig. 6 where both distorted test signal and corrected signal is plotted in a single graph.It is clearly visible that there is a slight difference between original signal and corrected signal.Now it is necessary to prove that corrected signal is linearized and time domain distortion has been eliminated.To evaluate if signal is corrected we again use signal time domain error estimation using signal level crossing that is described above.Now period length distribution for corrected signal is 0.00018 %.Although it was expected that time domain systematic error would be completely eliminated, calculations show that there is still an error.It can be explained as error resulting from calculation inaccuracy.If we use linear interpolation to determine zero crossing points and the same linear interpolation for signal correction and use precise zero crossing points that we calculated before, then signal should be completely corrected.Based on these assumptions it can be concluded that error is caused by calculation inaccuracy and can be neglected.
Figure 7 illustrates how signal periods have changed after correction.
In Fig. 7 it is possible to observe that after correction period lengths for current test signal are now all equal to average period length.
In [1] and [2] authors focus on spectrum estimation.It can be concluded from Fig. 8 that signal is corrected accurately.It is visible that corrected signal consists mainly of test signals repetition frequency and its harmonics.
As mentioned before errors can occur if no information about excitation signals frequency is known.It was assumed in this paper that time base distorted signal average period length is the same as it is for undistorted signal.It is visible from Fig. 8 that this assumption was not precise and spectrum components do not match.This error can be easily eliminated if excitation test signal frequency is known.In current work correction with error were made on purpose to make reader aware of problems that may occur.

V. EXPERIMENTAL RESULTS
In Table I experimental results are summarized with period length distributions for excitation signal   , distorted signal   and corrected signal   .Distortions are calculated using (3).Results are gathered from single acquisition device with nonlinear time distortion.Excitation signal acquired with real time oscilloscope as an etalon.Given results are for single acquisition and for average value from 10 independent acquisitions.

VI. CONCLUSIONS
Method shows how to estimate systematic time base error using periodic test signal.Any periodic signal can be used as test signal.Measuring each signal period length in the presence of systematic time base error, we can estimate systematic error pattern over time.Based on errors pattern we can then make corrections to distorted test signal.Since information about time domain error is acquired only at level crossing points we can assure that correction is precise at according points, but we can't ensure that signal is corrected precisely between those points.Unlike others this correction method may be used to eliminate systematic time base error with only mathematical techniques and without any hardware requirements.Method can also be used only for systematic errors estimation.
Method is valid even without test signal, if acquired signal has periodic pattern.Signal crossing points can be calculated from any periodic signal and does not depend from signals amplitude.That is why this method is suitable for Ultra wideband signal correction as well.

Fig. 1 .
Fig.1.Test signal example.Time axis marked with points to highlight that estimation can be used for any kind of signal and it does not depend on axis variables.

Fig. 3 .
Fig.3.Period length (points) distribution.There are 12 signal periods in test signal.Graph shows each period length calculated between zero crossing points.
the signal and eliminate time base distortion.

Fig. 4 .
Fig. 4. Signal level crossing points (red line), ideal signal level crossing line (black, dashed line).Ideally signal level crossing points must be separated by equal length and in graph must form a linear line.

Fig. 5 .
Fig. 5. Example of 3 level crossing points for distorted signal (a), corrected crossing points (b). 1 and  2 are first and second period lengths.
Based on their research we can estimate if proposed method corrects signal accurately by calculating time distorted and corrected signal amplitude spectrum with FFT.Since test signal is periodic it can be assumed that signal spectrum should consist of only signals main frequency and its higher harmonics.Any other components can be considered as result from noise or time base distortion.
Fig. 8. Distorted test signal (blue dotted line) and corrected test signal (red solid line) amplitude spectrum comparison.Since test signal is not attached to real time, frequency components can't be expressed with real values either.Each frequency step equal to 1/  where   is sampled time step.

TABLE I .
PERIOD LENGTH DISTRIBUTION.