Self-calibration of an oscilloscope using a square-wave test signal

Abstract: Self-calibration of a digitizer (104,106) is carried out by using a square-wave test signal which is digitized by the digitizer (104,106), and temporal positions of the digitized values output by the digitizer (104,106) are compared to respective reference periods of the test signal. The results of the comparison operations are then used by a microprocessor (110) to calculate a time delay for adjusting a clock signal supplied to the digitizer (104,106).

Description: The present invention is related to calibration of test equipment and, in particular, to calibration of a digitizer in an oscilloscope, for example, using a square-wave test signal, whereby a time delay for adjustment is calculated by a microprocessor on the basis of the digitized square-wave test signal. It is well known that a digitizer comprising, for example, a Sample-and-Hold (S/H) circuit and an analog-to-digital (A/D) converter, converts an analog signal to digital form. Due to the instantaneous changes of voltage in the input analog signal, the S/H circuit periodically samples the signal, in response to a clock signal, at particular points in time and holds (stores) a sampled voltage value to be input to the A/D converter. The A/D converter receives the sampled voltage value from the S/H circuit and obtains a digital representation based on a predetermined resolution (8 bits, 16 bits, etc.). If converted at least at the Nyquist rate, the analog signal is accurately represented by digital values and may be processed then by digital signal processing elements. Of course, the higher the frequency of the digitizer in performing the sampling, holding and converting operations as described hereinabove, the better the approximation between the input analog signal and its digital representation. In today's fast-paced world emphasizing ever increasing speed and processing, many analog signals have frequency components which would require a very fast digitizer to convert the analog signal to digital form. Such digitizers are typically quite expensive and may be cost prohibitive for certain applications. As a result, it has been suggested to use several digitizers, whereby digital values representing the analog signal are interleaved (time-multiplexed). For example, a digitizer, operating at a frequency F/2, acquires the input analog signal at times t1, t3, t5, t7 ... and generates respective digital values D1, D3, D5 ... of the analog signal; while another digitizer, also operating at the frequency F/2, acquires the analog signal at times t2, t4, t6 ... and generates digital values D2, D4, D6 ... of the same analog signal. It is apparent that the two digitizers acquire the analog signal for conversion at different times, and specifically the analog signal is sampled by the second digitizer between the sampling operation of the first digitizer (and vice versa). If the digital values from the two digitizers are interleaved, the analog signal is represented by the digital values D1, D2, D3, D4, D5, D6, D7 ... As a result, the effective sampling frequency of the analog signal is F, even though individual sampling frequencies of the digitizers are F/2. Proper operation of multiple digitizers employed in the above-described interleaved manner in digital oscilloscopes, for example, depends on a very precise timing. Among other things, clock signals supplied to the digitizers should be accurately controlled to achieve a predetermined phase shift. In the above example, the conversion of the analog signal to the digital values D2, D4, D6 by the second digitizer should occur precisely between the digital values D1, D3, D5, D7 generated by the first digitizer. That is, the digitizers should be triggered with clock signals having a high accuracy. The accuracy of clock signals that generate triggers for the digitizers becomes even more important when the number of digitizers operating in the interleaved mode increases. As the interval between the interleaved samples decreases, the accuracy of the trigger clock must increase to generate accurate interleaved digital values. In addition to clock signals, other factors such as temperature, humidity, physical characteristics of current conduits, etc. may affect the timing of the digitizers operating in the interleaved mode. In contrast to the clock signals generated by oscillators that may be manufactured with high precision albeit very expensively, the above-mentioned additional factors that influence the operation of the digitizers may be difficult to control. Periodic calibration (adjustment) of the digitizers is, therefore, necessary to obtain accurate digital values representing the analog signal. It is therefore imperative that the calibration of the digitizers should be performed quickly, accurately and without excessive hardware increasing the cost of the device or system. A need therefore exists for a device and method for realizing the above criteria. US 4,962,380 relates to a method and apparatus for calibrating an interleaved digitiser which master clock signal is digitised and the stored sample compared to a pre-determined reference level for subsequent adjustment of a phase shifting circuit. JP 9 - 1666 23 relates to skew correction for a multiphase digitizer. It is an object of the present invention to provide self-calibration of an oscilloscope. It is another object of the present invention to calibrate a digitizer using a square-wave test signal. It is a further object of the present invention to adjust a digitizer in test equipment without adding significant additional hardware or time-consuming software calculations. These and other objects, features and advantages are accomplished by a method and apparatus for performing calibration as defined in claims 1, 9, and 13, respectively. The inventive apparatus includes a signal generator for generating a reference signal having a preselected period; a digitizer for digitizing the reference signal to produce digitized values having respective amplitudes; and a programmable controller for obtaining, in each respective period, a temporal position of a digitized value with respect to a corresponding period of the reference signal. The programmable controller is operative to determine, based on the obtained temporal positions, a period, slope and delay corresponding to an approximate median value of the amplitudes such that sampling times of the digitizer are adjusted on the basis of the determined period, slope and delay. In accordance with one aspect of the present invention, the inventive apparatus further comprises a time base circuit for providing a clock signal to the digitizer to start the digitizing operation. The time base circuit is controlled by a control signal which is supplied by the programmable controller. Based on the determined delay, the timing of the clock signal is adjusted in response to the supplied control signal. Embodiments of the invention will now be described, by way of example, with reference to the drawings. The above-mentioned as well as additional objects, features and advantages of the present invention will become readily apparent from the following detailed description thereof which is to be read in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram of calibration apparatus in accordance with the present invention; Fig. 2a-2c illustrate operation of the calibration apparatus of Fig. 1. In all Figures, like reference numerals represent the same or identical components of the present invention. As a general overview, the present invention is directed to a self-calibration procedure in a digital oscilloscope with at least two digitizers per channel operating in an interleaved manner (so-called interleaved digitizers). The self-calibration procedure is performed by supplying a test waveform (reference signal) having a predetermined frequency to the channel digitizers. The test waveform is digitized, and the digital values are selected within a certain amplitude range. The delay of the selected digital values (that is, the actual samples of the test waveform) is measured with respect to the reference period (that is, the theoretical or reference period of the test waveform) . Based on the measured delay, an estimate of the sensitivity of the delay is obtained. To realize the calibration, the clock signal triggering the sampling operation of the digitizers is adjusted in response to the estimated delay. The present invention will now be discussed in detail with reference to the accompanying drawings. A block diagram of a single channel in a digital oscilloscope according to the present invention is shown in Fig. 1 while its operation will be explained on the basis of Figs. 2a-c. In order not to obscure the inventive concept, only selected elements are illustrated in the drawings. Since elements of the oscilloscope that are not shown in the drawings are well known to those skilled in the art, the description thereof will be omitted to avoid verbosity. Fig. 1 shows a signal generator 100 for generating a test waveform (the reference signal). According to one aspect of the present invention, the generated test waveform is a square-wave signal of a predetermined frequency which is not a multiple of the sampling rate of the digitizers. It is important that the frequency of the square-wave signal not be harmonically related to the sampling rate of the digitizers for the reason explained hereinbelow. As shown in Fig. 1, the square-wave signal from the signal generator 100 is supplied to a front end (FE) unit 102. The front end unit comprises one or more of the following components: an attenuator for attenuating the signal amplitude, a switch for switching the input between a test waveform and an actual input signal, a coupler for providing AC coupling of the signal, and other components as known to those skilled in the art. Also supplied to the front end unit 102 is an input analog signal as illustrated in Fig. 1. As mentioned above, the switch (not shown) in the front end unit 102 selects the test waveform from the signal generator 100 when the oscilloscope is in the calibration mode. Otherwise, the input analog signal is supplied to the front end unit 102 for subsequent processing in accordance with a typical operation of the oscilloscope including the measurement and display of signal, for example. Further shown in Fig. 1 are two digitizers 104, 106 selectively receiving substantially simultaneously either the input analog signal or the test waveform from the front end unit 102. Each digitizer representatively includes a Sample-and-Hold (S/H) circuit for sampling the instantaneous signal voltage and for storing the samples to prevent ambiguity during the subsequent conversion if the signal voltage changes abruptly. Also included in the digitizer is an Analog-to-Digital (A/D) converter for converting the samples received from the S/H circuit to digital form. The digital values produced by the A/D converter in each digitizer 104, 106 are stored in a memory unit 112 for subsequent processing by the system. Although the memory unit 112 is shown as a single element, it is understood that other embodiments of the present invention may include separate memory units for each digitizer, for example. The digitizers 104, 106 are driven by a clock signal generated by a time base circuit 108. Namely, each digitizer 104, 106 is activated by a signal from the time base circuit 108 as the interleaving of digital values supplied to the memory unit 112 is based on the clock signal alternately triggering the digitizers 104, 106. As mentioned above, the digitizers 104, 106 must be clocked at precise timing if a proper interleaving operation is to be carried out. As a result, it is necessary to perform a periodic calibration of the digitizers including the adjustment of clock signals. The clock signals may be delayed or advanced under control of a microprocessor 110, such as a central processing unit (CPU) or a programmable controller. In operation, the front end 102 is operative to select the square-wave signal (test waveform) generated by the signal generator 100 during the calibration procedure as shown in Fig. 2a. In actual implementation, the square-wave signal has a rising edge of approximately 350 psec., 20% to 80% amplitude level, when the channel is in high impedance coupling; at least several hundred cycles of the test waveform are obtained for calibration. After the square-wave signal is acquired (digitized), the relative delays of the digitizers 104, 106 are determined. That is, a temporal position of a digitized value is calculated with respect to a corresponding period of the reference signal. In particular, Fig. 2b shows successive time periods of the theoretical (reference) test waveform and the digital representation of the actual test waveform as produced by the digitizers 104, 106. The top and base of the actual test waveform are determined by the microprocessor 110 using histogram techniques. To eliminate the effects of ringing or unsettled signal, only digital values within an amplitude range of 20-80% are selected from the actual test waveform. As shown in Fig. 2b, digital values 2, 3 from one period of the test waveform are selected by the microprocessor 110, while digital values 1, 4 are rejected. Similarly, digital values 5, 6, 7, 8, etc. are extracted during the subsequent periods of the test waveform. Following the extraction of the digital values, the microprocessor 110 calculates the relative delays of the digitizers 104, 106 with respect to the theoretical test waveform periods as illustrated in Fig. 2b. The extracted digital values with the corresponding test waveform cycle are maintained by the microprocessor 110. The period, slope and delay of each extracted digital value are calculated, and then the cycle number of the test waveform is subtracted from each digital value. As a result, all of the digital values are normalized (overlaid onto the edge as represented by a linear fit). As mentioned earlier, the frequency of the square-wave signal should not be harmonically related to the sampling rate such that the reference signal has to slip phase relative to the sampling period of the digitizer. By observing this condition, the edge is populated evenly with samples (digital values). The above procedure may be best explained by using an illustration of Fig. 2c. The selected digital values within each cycle (period) of the reference test waveform are represented by points, and are plotted on a graph of Fig. 2c. It is as if all of the cycles (periods) of the reference test waveform in Fig. 2b have been overlaid on top of each other. When the points from each respective overlaid period are plotted in a single period, the digital values represented by those points form a so-called "cloud" as shown in Fig. 2c. In the actual implementation, approximately 200 digital values are maintained by the microprocessor 110, and a straight line is then fitted through the points on the graph as shown in Fig. 2c. The location on the line defining a 50% signal amplitude corresponds to the delay of the digitizers 104, 106 as represented by t d in Fig. 2c. The above operation may be performed several times until the time delays stop converging. If, however, after several iterations as described hereinabove the time delays do not converge, the calibration may not be possible. In this situation, a display message indicating that the calibration procedure cannot be performed successfully is generated to notify the operator of the failed attempt. Following the determination of the relative delay based on the preselected number of iterations, the microprocessor 110 controls the time base 108 accordingly in order to adjust the clock signals that trigger the operation of the digitizers 104, 106. The following description provides mathematical details of the calibration procedure in accordance with the present invention. Acquired Test Waveform At least several hundred cycles of the test waveform are acquired for each analog-to-digital converter (ADC). The test waveform spans about 5 divisions on the oscilloscope when the front end is set to 50 mV/div. It is expected to be an approximately square-wave with a frequency of 14.31818 MHz and with a rise/fall time of 1 ns or less. The algorithm is designed to make use of either slope (but NOT both simultaneously), and the final choice is based on performance. The acquired waveform points are labelled X(l(i)), wherein l(i) is the index of the points of a single ADC i(i=0.1...(NADC-1))). 1(i) runs fxom 0 to L-1, and L is the total number of data points in the record of each ADC. Gain + Offset Adjustment The top and base of the calibration signal from each digitizer is found using histogram techniques. From this the 20%, 80% and median levels for each digitizer are computed. Ideally the gain and offsets already match, but finding separate levels insures that any remaining mismatch does not translate into a delay error. The corrected ADC values, relative to median level, will be referred to as call Y(i). Fit to the Waveform Edges This analysis is individual for each participating ADC. Thus, the mathematics are common for each fit, and it is not necessary to refer to the ADC explicitly in the formulas. A) Find the data values of the ADCs which lie on a given slope (whether to use the positive or the negative slope is determined later), resulting in the following data values: Y(k) where the index k runs over all points ON THE SLOPE for the ADC i, 0<=k<K. K is the number of points which the ADC has on the slope. The algorithm for finding Y(k) includes following the acquired test waveform and retaining only those values which satisfy: {BASE+a*(TOP-BASE)} < Y(k) < {TOP-a*TOP-BASE)} and which are on either the rising or falling slope (this is determined by checking whether preceding values are either close to BASE or to TOP). BASE, TOP are determined for each ADC individually; a is typically between .1 and .2 (a fixed value is selected at implementation). B) For each useful data point, the following values can be determined: j the sample number (j=0...number of points in record); n the number of iterations of the test signal; These values are indexed by the same index which labels the data values, k. However, this index will not be explicitly written in the following equations. C) The data points must now be fitted to a multitude of linear equations, which represent many (rising or falling) slopes observed in the test waveform: V = A * (t-tzero) where A = slope of the waveform (ADC codes per nsec) t = sampling time (in nsec) = s * j where j = sample number s = sampling interval (in nsec) tzero = transition time (in nsec) of the fitted slope through the origin of the ADC (i.e., code 0000). This time is different for every test waveform slope. = (p+e)*n + d where p = nominal test signal period (in nsec) e = deviation of real test signal period from nominal (reference) test signal period (in nsec) n = iteration number of test signal d = ADC time shift (in nsec) It is noted that j, n are determined for every useful data point, s, p are constants (an error in s is not very important, because s just provides the time scale) e, d are determined by the fit V = A * (s*j - p*n - e*n - d) V = A*r - E*n - D with r = s*j-p*n E = A*e D = A*d The useful data values Y(k) must now be fitted to the expression above, in order to determine the 3 unknowns, A, E and D. Below, the following abbreviations are used: SR=SUM(k) {r * r} SN=SUM(k) {n * n} NR=SUM(k) {n * r} YR=SUM(k) (Y(k) * r} YN=SUM(k) {Y(k) * n} R=SUM(k) { r } N=SUM(k) { n } K=SUM(K) { l } Y=SUM(k) { Y(k) } Note that K is the number of (useful) data points. A*NR-E*SN + N*(Y-A*R+E*N)/K=YN which can be reformatted for the 2 unknowns A and E A * SR' - E * NR' = YR' A * NR' - E * SN' = YN' where the following new variables are used: SR' = SR - R*R/K NR' = NR - N*R/K SN' = SN - N*N/K YR' = YR - Y*R/K YN' = YN - Y*N/K The solutions then are A = (YR'*SN'-YN'*NR')/(SR'*SN'-NR'*NR') E = (YR'*NR'-YN'*SR')/(SR'*SN'-NR'*NR') D = -(Y-A*R+E*N)/K Of interest are the following parameters: e = E/A = deviation from nominal pulse period, should be close to zero. The 4 values e(i) should be equal within a very small value. d = D/A = ADC time shift in nsec For illustrative purposes, a single channel comprised of two digitizers was described and illustrated hereinabove. It is understood, of course, that more than two digitizers may be provided per channel, and more than one channel may be included in the digital oscilloscope. Further, while the rising edge of the test waveform was selected for the above illustrations of delay computations, the falling edge may be used just as well. That is, the above algorithm may utilize either a positive or negative slope of the test waveform. The above-described delay adjustment (calibration operation) may be performed on a real-time basis to interleave the digitized output in each channel, as well as between channels. The calibration procedure may take place when there is a change in temperature or at various stages of the operation of the oscilloscope: power-up, user mode change, periodically, etc. It will be appreciated that the oscilloscope with the delay adjustment according to the present invention has resolution of better than 2 psec. It will be further appreciated that in contrast to the prior art calibration procedures with long calibration time such as greater than 1 minute, the time for the above-described calibration operation is very small, and typically on the order of 1-2 seconds. Having described specific preferred embodiments of the invention with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various changes and modifications may be effected therein by one skilled in the art without departing from the scope of the invention as defined in the appended claims.

Claims: Apparatus for performing calibration, comprising: a signal generator (100) for generating a reference signal having a pre-selected period; a digitiser (102, 104) for digitising said reference signal to produce a plurality of digitised values having respective amplitudes; and a programmable controller (110) for obtaining, in each respective period, a temporal position of a digitised value with respect to a corresponding period of said reference signal, said programmable controller determining, based on the obtained temporal positions, a period, slope and delay corresponding to an approximate median value of the amplitudes such that sampling times of said digitiser are adjusted on the basis of the determined period, slope and delay. The apparatus according to claim 1, wherein prior to obtaining the temporal positions, said programmable controller (110) selects the digitised values within a predetermined amplitude range. The apparatus according to claim 1, further comprising another digitiser (101, 104) for digitising an input signal to produce digitised values that are interleaved with digitised values produced by the first-mentioned digitiser. The apparatus according to claim 1, further comprising a memory unit (112) for storing the digitised values. The apparatus according to claim 1, further comprising a time base circuit (108) for providing a clock signal to said digitiser (102, 104) to start a digitising operation, said time base circuit being controlled by a control signal supplied by said programmable controller (110). The apparatus according to claim 5, wherein the timing of said clock signal is adjusted in response to the supplied control signal based on the determined period, slope and delay. The apparatus according to claim 1, wherein said digitiser (102, 104) includes a sample-and-hold (S/H) circuit and an analog-to-digital converter (ADC). The apparatus according to claim 1, wherein said reference signal is a square-wave signal. A digital oscilloscope with a self-calibration operation, comprising: an input port for receiving an input signal; a signal generator (100) for generating a reference signal having a pre-selected period; a front end circuit (102) for selecting one of said input and reference signals; a digitiser (102, 104) for selectively digitising said input signal or said reference signal to produce a plurality of digitised values having respective amplitudes; and a programmable controller (110) for obtaining, in each respective period, a temporal position of a digitised value of said reference signal with respect to a corresponding period of said reference signal, said programmable controller (110) determining, based on the obtained temporal positions, a period, slope and delay corresponding to an approximate median value of the amplitudes such that sampling times of said digitiser are adjusted on the basis of the determined period, slope and delay. The apparatus according to claim 9, further comprising another digitiser (102, 104) for digitising said input signal to produce digitised values that are interleaved with the digitised values of said input signal produced by the first-mentioned digitiser. The apparatus according to claim 10, further comprising a time base circuit (108) for providing a clock signal to the digitisers (102, 104) to start a digitising operation, said time base circuit (108) being controlled by a control signal supplied by said programmable controller (110). The apparatus according to claim 11, wherein the timing of said clock signal is adjusted in response to the supplied control signal based on the determined period, slope and delay. A method for performing calibration in a digital oscilloscope, comprising the steps of: receiving an input signal; generating a reference signal having a pre-selected period; selecting one of said input and reference signals; selectively digitising said input signal or said reference signal to produce a plurality of digitised values having respective amplitudes; obtaining, in each respective period, a temporal position of a digitised value with respect to a corresponding period of said reference signal; and determining, based on the obtained temporal positions, a period, slope and delay corresponding to an approximate median value of the amplitudes such that sampling times in said oscilloscope are adjusted on the basis of the determined period, slope and delay. The method according to claim 13, further comprising the step of selecting the digitised values within a predetermined amplitude range prior to obtaining the temporal positions.

Inventors: HUNGERBUEHLER VIKTOR, SCHACHNER JOSEPH M, HUNGERBUEHLER, VIKTOR, SCHACHNER, JOSEPH M.
Applicants: LECROY CORP, LECROY CORPORATION
Application year: 1998
Main classification: G01R13
IPC codes: H03M1, G01R35, G01R13