A comparison of two robot telemetry records finds its cross-correlation peak at lag minus two samples. That result can be entirely consistent with the second record containing the same pattern two samples later. The sign belongs to the mathematical definition and input order, not to the word delay alone.

The distinction is easiest to inspect with a short asymmetric trace whose products can be calculated directly. This article uses original arrays and explicit zero-extension rules. It does not report an executed correlation routine or measured robot latency.

Define one discrete correlation convention

Let x have N samples and y have M samples. For real-valued arrays, define R_xy[k] = sum over n of x[n] y[n-k], treating every value outside each array's stored indices as zero.

The full lag domain runs from -(M-1) through N-1. That domain includes N+M-1 output positions. For complex data, the second factor would be conjugated; the present examples are real.

This matches the full-mode definition documented by SciPy 1.16.2 correlate. Other labels and returned delay conventions need to be read separately. In particular, MathWorks finddelay documents a positive reported delay when y is later than x, using the negative of a selected correlation lag.

A later pattern produces a negative peak lag

Choose x = [0, 2, -1, 3, 0, 0] and y = [0, 0, 0, 2, -1, 3, 0, 0]. Sample indices start at zero. The second array contains the complete first pattern shifted two positions later, with zeros surrounding it.

At k = -2, the factor y[n-k] is y[n+2]. Its nonzero values align with x's values at n = 1, 2, and 3. The sum is 2² + (-1)² + 3² = 14.

At k = -1, the overlapping nonzero products are (-1) × 2 and 3 × (-1), totaling -5. At k = -3, the products total -5 as well. At k = 0 or -4, the score is 6. All remaining lags give zero for this construction.

The maximum signed score is therefore 14 at -2, while the physical index shift of y relative to x is +2. With a declared sample interval of 5 ms, the latter corresponds to ten milliseconds in this invented common-timebase record.

Changing input order reverses the lag

For these real arrays, R_yx[k] = R_xy[-k]. Swapping the arguments moves the score of 14 to +2. The records themselves have not changed; the operation's reference order has.

The correlation output position is also not automatically its lag value. Here N = 6 and M = 8, so full-mode lags run from -7 through +5. The peak at -2 occupies zero-based output position five.

Labeling that fifth position as a five-sample delay would lose the lag-axis definition. A useful result keeps both input names and the explicit lag coordinates alongside the scores.

Signed peaks and absolute peaks answer different questions

Replace y by its negative. The exact alignment score becomes -14. Maximizing the absolute score still identifies the two-sample alignment, while maximizing the signed score alone selects another position.

That difference is why this hand calculation must not be presented as a universal reimplementation of finddelay, whose documented selection uses the largest absolute normalized correlation. A positive-copy assumption justifies the signed maximum in the original example; it is an additional interpretation.

Likewise, multiplying a record by a positive gain scales raw scores without changing their maximizing lag in this noise-free construction. A score's magnitude should not silently be interpreted as a probability or an accuracy estimate.

Overlap normalization changes the statistic

Full correlation uses fewer overlapping stored samples near its ends. Different normalizations can compensate for overlap, total record energy, or local mean and variance, but those choices define different scores.

As a separate original illustration, two overlapping zero-mean vectors [1,-1] and [1,-1] have normalized dot product one. So do [1,-1,2,-2] and themselves. Perfect normalized agreement does not reveal whether the comparison used two samples or four.

Short overlap can therefore produce a visually impressive normalized score without supplying a long observation. A reporting rule can retain overlap count or impose a minimum support requirement, but that requirement must be stated rather than inferred from a score near one.

Centering is another choice. Adding a large constant baseline to both records changes raw product sums, while a mean-subtracted score removes that constant contribution. These operations can prefer different alignments for general finite records. They are not interchangeable definitions of correlation.

A repeated pattern needs a restricted interpretation

For indefinitely repeated sequences x[n] = cos(pi n/2) and y[n] = x[n-2], shifts differing by four samples describe the same observed pattern. A period-averaged correlation cannot select which repetition caused a particular observation.

Finite windows can make one peak larger through their overlap and edge treatment, yet that numerical preference does not independently prove a unique physical event identity. Additional timing bounds or distinctive features would be needed for that inference.

This is a limit on pattern-based alignment. It does not make every correlation result ambiguous: the earlier asymmetric finite pulse had one unique maximum under its specified zero-extension rule.

An alignment estimate is not an entire clock model

The conversion from samples to milliseconds assumed equal spacing and a common timebase. Unequal rates, clock drift, resampling, changing delay, and waveform dynamics can all require additional modeling. One maximizing lag does not determine all of them.

For robot telemetry, the useful report retains the correlation formula, input order, lag axis, normalization, support, and timestamp basis. Those definitions explain how a negative peak lag can describe a later second record while keeping the alignment calculation separate from a physical latency claim.

Sources checked October 23, 2026:

SciPy 1.16.2, scipy.signal.correlate, Notes and full-mode definition: https://docs.scipy.org/doc/scipy-1.16.2/reference/generated/scipy.signal.correlate.html

MathWorks, finddelay, R2026b output and algorithm definitions: https://www.mathworks.com/help/signal/ref/finddelay.html

All arrays, overlap illustrations, and calculations are original hypothetical analysis; no domain software was executed.

Illustration note: The accompanying site-library robot beside a laptop is a data-processing concept scene. It does not show these traces, an executed correlation, or measured communication delay.