Main Content

timingError

Measure timing error from waveform

Since R2024b

Description

[TE,TEs] = timingError(x,y,SymbolTime = t) measures the timing error from input jittery waveform by using the specified symbol time.

[TE,TEs] = timingError(y,SampleInterval = s,SymbolTime = t) measures the timing error by using the specified sample interval and symbol time.

[TE,TEs] = timingError(x,y,xr,yr) measures the timing error from input jittery waveform with respect to the reference waveform.

[TE,TEs] = timingError(y,yr,SampleInterval = s) measures the timing error with respect to the reference waveform and specified sample interval.

[TE,TEs] = timingError(___,Name=Value) measures the timing error using name-value arguments. Unspecified arguments take default values.

[TE,TEs,TEindex,refTimes] = timingError(___) measures the amplitude, frequency, and phase of the timing error using the above arguments.

Input Arguments

collapse all

Time coordinates of the jittery signal, specified as a monotonically increasing vector.

If you do not provide y, the function interprets x as edge times.

Data Types: double

Amplitude coordinates of the jittery signal, specified as a vector or as an eyeDiagramSI object.

If you do not provide x, the function assumes y is uniformly sampled at the rate specified by SampleInterval.

Data Types: double

Time coordinates of the reference signal, specified as a monotonically increasing vector.

Data Types: double

Amplitude coordinates of the reference signal, specified as a vector. If you do not provide x, yr must be sampled at the same points as y.

Data Types: double

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: J = timingError(x,y,SampleInterval = s) calculates the timing error from the input waveform defined by (x,y) and sample interval specified by s.

Thresholds to separate symbol levels in the jittery waveform, specified as a vector. If you do not provide SymbolThresholds, the function calculates it from the histogram of y.

Data Types: double

Thresholds to separate symbol levels in the reference waveform, specified as a vector. If you do not provide ReferenceThresholds, the function calculates it from the histogram of yr.

Data Types: double

Sample time for uniformly sampled jittery and reference waveforms, specified as a scalar.

When you provide the time vectors of jittery and reference signals, the function ignores SampleInterval and uses time vectors instead.

Data Types: double

Symbol time for uniformly sampled jittery and reference waveforms, specified as a scalar. For clock waveforms, SymbolTime is half the of the period.

Data Types: double

Options to compare the data edge to the clock edge, specified as one of these:

  • time — Compares the closest edge times.

  • order — Compares the first edge on each set.

The function uses this argument in two scenarios only:

  • Both the measured and reference waveforms are clocks.

  • The measured waveform is a data waveform and the reference waveform is a clock waveform.

When both waveforms are data waveforms with the same pattern, the function matches the edges is based on the pattern.

Positive feedback gain for hysteresis, specified as a real scalar in the range [0, 1]. The function uses DebounceGain to calculate the modified thresholds by using the equation:

thresholdnew(i)=thresholdold(i)+DebounceGain·EyeAmplitude(i)2

Data Types: double

Fraction of a unit interval to hold the hysteresis threshold level before returning to the nominal threshold, specified as a nonnegative scalar in the range [0, 1].

Data Types: double

Custom channel delay, specified as a real scalar.

If your data has aggressive decision feedback equalization, you can manually override the channel delay compensation calculated by the jitter function and specify the delay of the measured waveform (x,y) with respect to the reference waveform (xr,yr). A positive Delaytime indicates that a reference edge matches to an edge later in time in the measured signal. A negative Delaytime indicates that a measured edge matches to an edge later in time in the reference signal.

Data Types: double

Output Arguments

collapse all

Chronological timing error, returned as a vector.

Sorted timing error based on the measured waveform edge, returned as a cell array. Each cell contains a type of edge (symbol transition). The rows of the cell array denotes the origin symbols and the columns denote the destination symbol.

Index for timing error, returned as an N-by-3 matrix. N is equal to the number of elements in the TE vector.

Reference edge time for each element of TE vector, returned as a vector of the same length as TE. The edge times in the jittery waveform is the sum of refTimes and TE.

Version History

Introduced in R2024b