WAVEFORM TIMING ALIGNMENT SYSTEM FOR DIGITAL OSCILLOSCOPES

Abstract: A method and an apparatus detect the presence of and correct for timing misalignment between waveforms acquired by digital oscilloscopes. In a preferred embodiment, a digital oscilloscope (50) includes a waveform alignment system (60) that receives a first waveform (86) and a similar second waveform (88) of a periodic electrical signal. A digital signal processor (80) of the waveform alignment system generates an autocorrelation value in connection with the first waveform and a first cross-­ correlation value in connection with the first and second waveforms and compares the values to determine whether they differ by more than a preselected tolerance, thereby to detect a timing misalignment between the first and second waveforms. Upon detection of a timing misalignment, the digital signal processor computes a shifted second waveform by changing the timing relationship of the second waveform relative to the first waveform and generates a second cross-correlation value in connection with the first waveform and the shifted second waveform. The digital signal processor shifts the second waveform relative to the first waveform such that the second cross-correlation value differs from the autocorrelation by less than the preselected tolerance, thereby to correct the timing misalignment.

Description: Technical Field The present invention relates to digital oscilloscopes and, in particular, to a system for achieving temporal alignment of waveforms acquired by such oscilloscopes. Background of the Invention A conventional digital oscilloscope takes discrete periodic samples of multiple analog input signals and processes the samples to render on a display screen light images of the input signals. Fig. 1 is a schematic representation of a prior art method by which one type of digital oscilloscope acquires multiple similar waveforms 10a-10c of a continuous-wave sinusoidal analog signal 12. Waveforms 10a-10c are formed by multiple discrete voltage samples acquired at similar times during successive cycles of analog signal 12. Corresponding voltage samples are taken at similar times during each of the waveform portions and are identified by identical reference numerals and lower case suffixes, the latter of which indicates the particular waveforms. For example, samples 14a, 14b, and 14c and samples 34a, 34b, and 34c represent two different groups of three corresponding samples. The formation of a digital signal is described below by way of example mainly with reference to waveform 10a. Waveform 10a is represented by a data record that includes digital words representing multiple discrete voltage samples 14a-34a acquired during an acquisition period 36a. Samples 14a-34a represent the measured voltage amplitude values of analog signal 12 at periodic time intervals. The measured amplitude values typically form the vertical component of a display waveform rendered on the display screen of the digital oscilloscope. The horizontal component of the display waveform is typically formed by a time base sweep representing an acquisition period. Acquisition period 36a begins at the end of a trigger system reset period 38a in response to a triggering event 42a. Triggering event 42a occurs after reset period 38a when analog signal 12 crosses a preselected trigger voltage level 44 with a slope of a predetermined polarity. Analog signal 12 typically includes an aperiodic noise component (not shown) characterized as a random variation in the voltage amplitude (i.e., the vertical component) of analog signal 12. Digital storage oscilloscopes of certain types correlate corresponding samples of waveforms 10a-10c and compute for each group of them an average voltage amplitude, thereby to form a display waveform having a voltage amplitude representing the average voltage amplitudes computed for different times in a cycle of analog signal 12. The averaging of corresponding samples can form a display waveform having a better vertical resolution (i.e., signal-to-noise ratio) than the vertical resolution of each of the acquired waveforms 10a-10c. The reason is that the averaging of relatively large numbers of corresponding samples tends to "average out" the noise component of analog signal 12. In an electrically noisy environment, however, the voltage amplitude of the noise component of analog signal 12 can be comparable to that of its periodic signal component. Such a noise component could cause the voltage amplitude of analog signal 12 to cross trigger voltage level 44 at random intervals, thereby erroneously triggering any of the acquisition periods 36a-36c. Such an erroneous triggering results in a time misalignment or offset of samples otherwise corresponding to one another. The correlation of corresponding samples during averaging would, therefore, be improperly performed and, as a consequence, would result in the formation of different display waveforms that do not accurately represent analog signal 12. Moreover, the different display waveforms could cause the image representing analog signal 12 to appear unstable, a condition that is sometimes called "trigger jitter." A prior art method and apparatus for processing waveform records is shown in applicants' own earlier application EP 0257324 which discloses circuitry to correct jitter between two waveform records. Factors which represent a delay applied to one of the records are adjusted to reduce the power of a signal representing the difference between the records. The circuitry is operated in conjunction with a separate oscilloscope. SUMMARY OF THE INVENTION An object of this invention is, therefore, to provide a system for achieving temporal alignment of waveforms acquired by digital oscilloscopes. Another object of this invention is to provide such a system that promotes the reduction of trigger jitter in digital oscilloscopes. A further object of this invention is to provide such a system that facilitates reliable operation of a digital oscilloscope in an electrically noisy environment. The present invention is a method for achieving temporal alignment of waveforms acquired by digital oscilloscopes as recited by the characterising portion of claim 1 and apparatus for the same as recited in the characterising portion of claim 9. By temporally aligning acquired waveforms, this invention can reduce trigger jitter and allow a digital oscilloscope to operate in an electrically noisy environment. According to the invention, a digital storage oscilloscope acquires first and second data records that represent respective first and second similar waveforms of a periodic electrical signal. A waveform alignment system included as part of the oscilloscope generates an autocorrelation value in connection with the first waveform and a cross-correlation value in connection with the first and second waveforms. The autocorrelation value is an approximation to the autocorrelation of the first waveform, and the cross-correlation value is an approximation to the cross-correlation of the first and second waveforms. The waveform alignment system compares the autocorrelation value with the cross-correlation value to determine whether the values differ by more than a preselected tolerance. A difference between such values of more than the preselected tolerance represents a timing misalignment between the first and second waveforms. The magnitude of the difference between the autocorrelation value and cross-correlation value is proportional to the amount of timing misalignment between the first and second waveforms. Such a timing misalignment can be caused, for example, by an erroneous triggering event. Whenever the autocorrelation value and cross-correlation value differ by more than the preselected tolerance, the waveform alignment system of the present invention adjusts the timing alignment between the first and second waveforms and generates a new cross-correlation value for the realigned first and second waveforms. The timing alignment between the first and second waveforms is adjusted such that the new cross-correlation value differs from the autocorrelation value by less than the preselected tolerance, thereby correcting the waveform timing misalignment caused by a triggering error. Additional objects and advantages of the present invention will be apparent from the following detailed description of a preferred embodiment thereof, which proceeds with reference to the accompanying drawings. Brief Description of the Drawings Fig. 1 shows a continuous-wave sinusoidal signal comprised of three waveforms acquired and processed in the form of discrete voltage samples in accordance with a prior art method by a digital oscilloscope. Fig. 2 is a simplified block diagram of a digital oscilloscope that includes a waveform alignment system of the present invention. Fig. 3 is a diagram showing the timing alignment between two exemplary acquired waveforms. Fig. 4 is a flow diagram showing the operation of the waveform alignment system of Fig. 2. Detailed Description of Preferred Embodiment Fig. 2 shows a digital storage oscilloscope 50 having an input terminal 52 that receives, for example, a continuous-wave analog voltage signal having a periodic signal component and an aperiodic noise component. A digitizing subsystem 54 receives the analog signal and generates at periodic intervals 8-bit digital words that represent samples of the voltage amplitude of the analog signal. Digitizing subsystem 54 includes an analog-to-digital converter (not shown) that acquires multiple voltage samples of the analog signal during an acquisition period. The acquisition period is started or concluded by a triggering event, the nature of which depends upon a selected one of a variety of possible triggering modes. By way of example, the acquisition period begins with a triggering event that occurs at the end of a trigger system reset period. The triggering event occurs when the voltage amplitude of the analog signal crosses a preselected trigger voltage with a slope of a preselected polarity. It will be appreciated, however, that triggering events could alternatively be referenced to signals other than the analog signal being measured by oscilloscope 50. During each acquisition period, a time base generator 56 develops repetitive sample timing signals that establish the rate at which the voltage samples are acquired. The multiple samples acquired during an acquisition period form a data record that represents the analog signal waveform. Since the analog signal includes a periodic signal component, digitizing subsystem 54 acquires multiple data records that represent multiple, similar waveforms of the analog signal. The multiple, similar waveforms are averaged to form a display waveform that is rendered on the display screen (not shown) of oscilloscope 50, as described below in greater detail. Digitizing subsystem 54 delivers to a waveform alignment means or system 60 the data records that represent the multiple waveforms. Alignment system 60 identifies and corrects timing differences associated with corresponding samples of the analog signal waveforms. Such differences can be caused by triggering errors that introduce timing misalignments between different ones of the analog signal waveforms. After identifying and correcting any timing misalignments between the analog signal waveforms, alignment system 60 generates a data record that represents a display waveform and delivers the display waveform data record via a data bus 62 to a display memory 64. A display control circuit 66 of a display subsystem 68 obtains the data record from display memory 64. Display control circuit 66 generates in accordance with the display waveform data record deflection signals by which a cathode-ray tube 70 forms an image representing the analog signal. Alignment system 60 includes an acquisition memory circuit 78 that functions as an input buffer for the data records acquired by digitizing subsystem 54. Acquisition memory 78 communicates via data bus 62 with a digital signal processor 80 that performs data manipulations by which waveform timing misalignments are identified and corrected and by which the display waveform data record is generated. Digital signal processor 80 stores intermediate results of its data manipulations in a temporary or "scratch" memory 82 that is in data communication with data bus 62. Fig. 3 shows an exemplary first waveform 86 and a similar exemplary second waveform 88 that are acquired by oscilloscope 50 during two different acquisition periods. Waveforms 86 and 88 represent portions of a continuous-wave analog signal having a periodic signal component that resembles a clipped triangle wave. Waveform 88 includes an exemplary noise spike or component 90 that causes an erroneous triggering event and thereby initiates the acquisition of waveform 88. Each of the data records that represent waveforms 86 and 88 comprises 512 samples that are acquired by digitizing subsystem 54. Each sample is an 8-bit digital word having a value of between -128 and +127. The digital values represent different voltage amplitudes for different voltage ranges that are preselectable by the oscilloscope operator. It will be appreciated that the data records could include different numbers of samples and digital words having different numbers of binary bits. With reference to Figs. 2 and 3, digitizing subsystem 54 acquires the data records representing waveforms 86 and 88 during respective first and second acquisition periods. The data records are stored in acquisition memory 78 and are available via data bus 62 to digital signal processor 80. As a result of the erroneous triggering event caused by noise spike 90, waveform 88 leads waveform 86 by an amount of time corresponding to 16 samples and is, therefore, misaligned with waveform 86. Digital signal processor 80 generates in connection with waveform 86 an autocorrelation value R xx that provides a "signature" of waveform 86. The autocorrelation value is preferably an approximation of, but could be equal to, the autocorrelation of waveform 86. To generate the autocorrelation value R xx , digital signal processor 80 identifies an edge 96 of waveform 86. Edge 96 preferably has a mean value and a slope with an absolute value that are greater than the corresponding means values and absolute slope values for other edges in waveform 86. Digital signal processor 80 identifies edge 96 by computing the slope and mean value of successive pairs of samples of waveform 86. The samples of each pair are separated by an interval of about 1/16 the length of waveform 86 (i.e., about 32 samples) and are positioned within the first 3/4 of the length of waveform 86 (i.e., among samples 0-383). The evaluation of the pairs proceeds successively in increments of one sample from a first pair of samples 0 and 31 to a last pair of samples 352 and 383. The pair of samples of waveform 86 that has in combination the greatest mean and absolute slope values is designated as edge 96. Whenever several portions of waveform 86 have the greatest mean and absolute slope values, digital signal processor 80 designates one, for example, the first, such pair as edge 96. For purposes of clarity, the fourth such pair is shown as edge 96 in Fig. 3. Once edge 96 is identified, digital signal processor 80 designates a "slice" 98 of waveform 86. Slice 98 is positioned symmetrically about edge 96 and comprises 1/8 of the total number of samples (i.e., 64 samples) that form waveform 86. The autocorrelation value R xx is calculated with respect to slice 98, which will typically provide an accurate characterization of waveform 86. The autocorrelation value R xx generated by digital signal processor 80 is the first-order or peak autocorrelation value. The 64 samples that form slice 98 are designated x₁, x₂, x₃, . . , x₆₄ and represent samples 160-223, respectively, of waveform 86. The autocorrelation value R xx that is generated in connection with waveform 86 is, therefore, represented as: R xx = x₁x₁ + x₂x₂ + x₃x₃ + . . . + x₆₄x₆₄. The autocorrelation value R xx is stored in scratch memory 82 as a signature of waveform 86. Digital signal processor 80 generates in connection with waveforms 86 and 88 a cross-correlation value R xy . The cross-correlation value is preferably an approximation of, but could be equal to, the cross-correlation of waveforms 86 and 88. To generate the cross-correlation value R xy , digital signal processor 80 designates a slice 100 of waveform 88 that corresponds in a sample-by-sample manner to slice 98 of waveform 86. As a result, slice 100 includes 64 samples that are designated y₁, y₂, y₃, . . , Y₆₄ and represent samples 160-223, respectively, of waveform 88. The cross-correlation value R xy generated by digital signal processor 80 is the first-order or peak cross correlation value and is represented as: R xy = x₁y₁ + x₂y₂ + x₃y₃ + . . . + x₆₄y₆₄. Digital signal processor 80 recalls the autocorrelation value R xx from scratch memory 82 and compares the value with the cross-correlation value R xy . Differences between the magnitudes of the autocorrelation and cross-correlation values are proportional to the amount of timing misalignment between waveforms 86 and 88 and are indicative of triggering errors. To improve the accuracy by which digital signal processor 80 identifies timing misalignments of relatively small amounts or between waveforms represented by digital words of relatively large values (e.g., waveforms positioned near the top of the oscilloscope display screen), digital signal processor 80 calculates a mean value M of the samples that comprise slice 98. Prior to the calculation of the autocorrelation value R xx and the cross-correlation value R xy , the mean value is subtracted from each one of the sample values x₁, x₂, x₃, . . , x₆₄ and y₁, y₂, y₃, . . , y₆₄. The subtraction of the mean value M from each of the sample values results in autocorrelation and cross-correlation values of relatively small magnitudes. Differences between such small autocorrelation and cross-correlation values more accurately identify relatively small timing misalignments because a small difference is more discernable between two small values than it is between two large values. For example, the difference between the values 100 and 101 represents only 1% of the magnitudes of the values; whereas, the same difference between the values 1 and 2 represents up to 100% of the magnitudes of the values. Such a 100% difference is much more discernable than a 1% difference. Whenever the autocorrelation and cross-correlation values differ by more than a preselected tolerance, waveforms 86 and 88 are classified as being misaligned. As a result, the samples that comprise slice 100 of waveform 88 are reassigned by an increment of one sample so that the samples y₁, y₂, y₃, . . ., y₆₄ represent samples 161-224, respectively. Such a reassignment corresponds to shifting slice 100 by one sample interval relative to slice 98. An updated or new cross-correlation value R xy is calculated in connection with the shifted slice 100 and slice 98. The new cross-correlation value R xy is compared with the autocorrelation value R xx to determine whether the values differ by more than the preselected tolerance. The sequence of reassigning the samples that comprise slice 100, generating a new cross-correlation value R xy , and comparing the new cross-correlation value R xy with the autocorrelation value R xx is repeated until the difference between the autocorrelation value R xx and the new cross-correlation value R xy is less than the preselected tolerance, thereby aligning slice 100 with slice 98. Whenever the difference between each one of the new cross-correlation values R xy and the autocorrelation value R xx is greater than the preselected tolerance, the alignment by which the difference is the least is identified, thereby establishing a "closest" or "best fit" alignment between slice 100 and slice 98. The reassigning of the samples that comprise slice 100 of waveform 88 proceeds such that slice 100 is alternately shifted to the right and left by increasing numbers of samples. In particular, samples y₁, y₂, y₃, . . ., y₆₄ originally represent samples 160-223, respectively, of waveform 88. After the first reassignment of samples described above, the samples y₁, y₂, y₃, . . ., y₆₄ represent samples 161-224, respectively. In a second reassignment, the samples y₁, y₂, y₃, . . ., y₆₄ represent samples 159-222, respectively. In a third reassignment, the samples y₁, y₂, y₃, . . ., y₆₄ represent samples 162-225, respectively. The reassignment of the samples y₁ y₂, y₃, . . ., y₆₄ proceeds in this "oscillating" sequence until the difference between the autocorrelation value R xx and the cross-correlation value R xy is less than the preselected tolerance. The amount by which slice 100 is shifted relative to slice 98 to obtain a difference less than the preselected tolerance is designated an "aligning" amount. To correct a timing misalignment between waveforms 86 and 88, digital signal processor 80 shifts waveform 88 relative to waveform 86 by the aligning amount established by slices 98 and 100. For example, a relatively small tolerance could result in waveform 88 being shifted to the left by 16 samples. Such a shift would generate 16 "empty" samples on the right end of waveform 88, which samples are assigned null values and correspond to blanked portions of the display waveform. The display waveform is then formed by generating average values for corresponding ones of the nonblanked samples of the aligned waveforms 86 and 88. The preselected tolerance is a user-selectable quantity that allows waveforms 86 and 88 to be aligned although they include different aperiodic noise components. In addition to the noise spike 90 that causes the triggering error, waveforms 86 and 88 typically include different noise components that would prevent the autocorrelation value R xx from being equal to the cross-correlation value R xy even if the waveforms were perfectly aligned. The preselected tolerance provides, therefore, a means for compensating for different noise components on waveforms 86 and 88. In particular, larger preselected tolerances compensate for noise components of larger magnitudes. The preselected tolerance also allows a user to accept a nonzero but imperceptible amount of misalignment between waveforms 86 and 88 to thereby increase the rate at which the waveforms are aligned. Fig. 4 is a flow diagram showing with reference to Fig. 2 the process steps by which misalignment between waveforms 86 and 88 is corrected. It will be appreciated that these process steps can be programmed into and performed by a computer or microprocessor or alternatively, be performed by a dedicated electronic circuit. Process block 110 indicates the identification of a reference edge 96 of waveform 86. The reference edge preferably has a large mean value and a slope having a large absolute value. The step represented by process block 110 is accessed upon the completion of the acquisition of waveform 86, which is designated a reference waveform. Process block 112 indicates the designation about edge 96 of a reference slice 98 of 1/8 the number of samples of waveform 86. Digital signal processor 80 computes a mean value M of the samples that form reference 98 and subtracts the mean value M from each of the samples to generate a modified reference slice 98. Digital signal processor 80 then computes a peak autocorrelation value R xx in connection with modified reference slice 98, and delivers the value to scratch memory 82 as a unique signature of reference waveform 86. Process block 114 indicates the acquisition of the data record representing waveform 88. Process block 116 indicates the designation of slice 100 of waveform 88, the subtraction by digital signal processor 80 of the mean value M from each one of the samples that form slice 100, and the computation by digital signal processor 80 of a cross-correlation value R xy in connection with modified reference slice 98 of reference waveform 86 and modified slice 100 of waveform 88. Process block 118 indicates the comparison by digital signal processor 80 of the cross-correlation value R xy to the autocorrelation value R xx . Decision block 120 represents an inquiry as to whether the autocorrelation value R xx and cross-correlation value R xy differ by more than the preselected tolerance. If the values differ by more than the preselected tolerance, decision block 120 proceeds to process block 122. If the values differ by the preselected tolerance or less, decision block 120 proceeds to process block 124. Process block 122 indicates the shifting of slice 100 of waveform 88 (i.e., the reassignment of samples that form slice 100) by one sample interval relative to reference slice 98 of reference waveform 86. The sample interval by which slice 100 is shifted will alternately be a leading interval and a lagging interval. Process block 122 then returns to process block 116. Process block 124 indicates the alignment of waveform 88 with reference waveform 86 by the shifting of waveform 88 (i.e., the reassignment of samples that form waveform 88) in accordance with the aligning amount by which slice 100 is aligned with reference slice 98. The alignment of waveform 88 with reference waveform 86 corrects the timing misalignment related to the triggering error caused by noise spike 90. Process block 126 indicates the computation of averages for corresponding samples of aligned waveforms 86 and 88, thereby to provide a display waveform that is delivered to display memory 64. The present invention allows waveforms 86 and 88 to be aligned very quickly so that the display waveform is generated and displayed in a "real time" fashion. In particular, employing slices 98 and 100 to determine the aligning amount and calculating only the peak autocorrelation and cross-correlation values allows waveforms 86 and 88 to be aligned quickly and relatively accurately. It will be appreciated, however, that higher-order levels of the autocorrelation and cross-correlation values could be calculated to more accurately align waveforms 86 and 88. Similarly, slices 98 and 100 could include larger portions of the respective waveforms 86 and 88 to more accurately characterize the waveforms. Such calculations could, however, interfere with the real-time generation of the display waveform. It will be obvious to those having skill in the art that many changes may be made to the details of the above-described preferred embodiment of the present invention without departing from the underlying principles thereof. For example, more than two waveforms can be aligned by means of this invention. Moreover, generating interpolation samples between acquired samples could be employed to increase the resolution by which a waveform is represented and thereby improve the accuracy by which waveforms are aligned. The scope of the present invention should be determined, therefore, only by the following claims.

Claims: A method of achieving temporal alignment between first and second similar waveforms of a periodic signal, the method including the steps of acquiring first and second data records from the periodic signal representing the first and second waveforms, respectively, and processing the first and second data records to form a display waveform for rendering on a display screen (70) , the method being characterized by the steps of: generating an autocorrelation value for the first waveform from the first data record; generating a first cross-correlation value between the first and second waveforms from the first and second data records; determining whether the autocorrelation value and the first cross-correlation value differ by more than a preselected tolerance to detect temporal misalignment between the first and second waveforms; and upon detection of temporal misalignment, repeatedly shifting the second data record relative to the first data record and generating a cross-correlation value between the first waveform and shifted second waveform from the first and shifted second data records, until the autocorrelation value and the cross-correlation value differ by less than the preselected tolerance, whereby the first and second waveforms are in temporal alignment. The method of claim 1 in which the autocorrelation value and the cross-correlation values constitute peak autocorrelation and peak cross-correlation values, respectively. The method of claim 1 in which a first portion of the first data record and a second portion of the second data record are used to generate the autocorrelation and cross-correlation values. The method of claim 3 in which the repeatedly shifting and generating step is characterized by repetitively shifting the portion of the second data record used as the second portion by different amounts relative to the first portion, generating and comparing the cross-correlation value each time the second portion is shifted until the difference between the autocorrelation and cross-correlation values is less than the preselected tolerance, the amount of the shift of the second portion necessary to obtain this being an aligning amount. The method of claim 4 in which the second data record is shifted relative to the first data record by an amount equal to the aligning amount to bring the first and second waveforms into temporal alignment. The method of claim 1 further characterized by the step of averaging corresponding values from the shifted second data record with the first data record to form the display waveform when the difference between the autocorrelation and cross-correlation values is less than the preselected tolerance. The method of claim 1 further characterized by the steps of: generating a mean value for preselected samples of the first data record; and subtracting the mean value from each of these preselected samples and from preselected samples of the second data record to generate first and second sets of modified samples, respectively, the autocorrelation and first cross-correlation values being generated using the first and second sets of modified samples. The method of claim 7 further characterized by the step of subtracting the mean value from preselected samples of each shifted second data record to generate a set of modified samples which are used with the first set of modified samples to generate the corresponding cross-correlation value. A digital oscilloscope (50) of the type having a digitizing subsystem (54) for acquiring first and second data records that represent respective first and second similar waveforms of a periodic signal, a display subsystem (68) that forms from the first and second data records an image that represents the periodic signal, and waveform alignment means (60) for detecting a timing misalignment between the first and second waveforms and for aligning the first and second waveforms whenever such timing misalignment is detected, the digital oscilloscope (50) being characterized by means (80, 82) for generating an autocorrelation value for the first waveform from the first data record, for generating a first cross-correlation value between the first and second waveforms from the first and second data records, for comparing the autocorrelation and first cross-correlation values to determine whether they differ by more than a preselected tolerance to thereby determine a temporal misalignment, and when the temporal misalignment is determined, for repeatedly shifting the second waveform relative to the first waveform and generating a cross-correlation value between the first waveform and the shifted second waveform, until the autocorrelation value and the cross-correlation value differ by less than the preselected tolerance, thereby achieving temporal alignment between the first and second waveforms. The oscilloscope (50) of claim 9 wherein the waveform alignment means is further characterized by means for designating a first portion of first data record and a second portion of the second data record, the autocorrelation and first cross-correlation values being generated from the first and second portions.

Inventors: KAREEM, ARIF, KNIERIM, DANIEL G., WALKER, GEORGES S.
Applicants: TEKTRONIX INC.
Application year: 1989
Main classification: G01R13
IPC codes: G01R13, G01R29, H03K5