Dieser Leitfaden ist derzeit auf Englisch verfügbar.
Technology / Technical guide
Cross-Correlation: Lag Sign, Similarity & Time Delay
Cross-correlation compares two sequences over relative shifts. A peak can show where their patterns align under a chosen convention, but its sign depends on the definition and input order. Common excitation, filtering and repeated patterns can create alignment without one signal directly causing the other.
A lag belongs to a formula and ordered signal pair.
Keep the mathematical sign separate from the physical statement that one observation occurs later.
01 / Convention
Input order determines the lag sign.
For the finite deterministic convention used here, Rxy[m] = Σx[n+m] y*[n], with sequences zero outside the represented support.
For the finite deterministic convention used here, Rxy[m] = Σx[n+m] y*[n], with sequences zero outside the represented support. The star denotes complex conjugation; it has no effect for real-valued samples. This matches the ordering described by MathWorks.
Under this convention, if y is a delayed copy x[n−d] with positive d, matching occurs at m = −d. Another definition or reversing the input order changes the displayed sign. The physical meaning should accompany the index.
02 / Pulse example
An invented delayed pattern gives a negative lag.
Hypothetical sequences: x has values 2 and 1 at indices 2 and 3; y has the same values at indices 4 and 5, with all other values zero over an eight-sample record.
Hypothetical sequences: x has values 2 and 1 at indices 2 and 3; y has the same values at indices 4 and 5, with all other values zero over an eight-sample record. Then y is delayed by two samples.
The matching correlation at m = −2 is 2²+1² = 5 arbitrary squared units. With a common interval of 0.05 seconds, the physical delay is 0.10 seconds. These numbers describe discrete arithmetic, not a sensor latency or a recommended time correction.
03 / Normalisation
Raw sums and centred relationships answer different questions.
An unnormalised sum changes with signal scale and the available overlap.
An unnormalised sum changes with signal scale and the available overlap. A normalised coefficient compares quantities on a declared scale, while subtracting a mean produces a different centred relationship. These conventions should not be silently mixed.
A large constant component can contribute to raw similarity even where variations have little shared structure. A coefficient near one therefore needs its actual denominator, centring and interval meaning; its appearance alone does not identify why the patterns agree.
04 / Finite overlap
Different lags can use different portions of the record.
As one finite sequence shifts relative to another, the overlapping support changes.
As one finite sequence shifts relative to another, the overlapping support changes. Boundary treatment and denominator conventions alter the reported estimate. A large value at an extreme shift may be based on less shared information than a value near the centre.
The deterministic sum is well-defined without a statistical stationarity assumption. Interpreting it as an estimate of a population relationship, however, adds assumptions about how the observed interval represents the process. These are separate uses of the same mathematical operation.
05 / Repeated patterns
One peak does not always identify a unique delay.
A periodic pattern can align at several shifts separated by its repetition period.
A periodic pattern can align at several shifts separated by its repetition period. Noise, distortion and frequency-dependent filtering can further move or broaden a peak. A single constant-shift model may not adequately describe both records.
The delay guide describes a pure time shift, while coherence asks a frequency-specific question. Neither should be inferred solely from a convenient correlation maximum.
06 / Interpretation
Shared timing does not establish causal direction.
Two signals can respond to a common third influence, or share a processing dependency.
Two signals can respond to a common third influence, or share a processing dependency. An ordered correlation formula does not make its first argument the physical cause. Timestamp conventions also remain independent evidence rather than becoming correct because patterns align.
No MARSTON delay or fault diagnosis is assigned. This explanation provides no clock recalibration, signal shifting, field experiment or control adjustment; it clarifies why an alignment statistic needs its convention and causal boundary.
Related technical guides: Frequency Coherence: Shared Content & Evidence Limits · Feedback Delay: Phase Lag and Stability Boundaries · Sampling Jitter: Timing Error, Signal Slope & SNR.
General background: MathWorks: Ordered cross-correlation, lag signs and normalisation. These references explain industry concepts; they are separate from the applicable MARSTON product and project documents.
Key concepts and conditions.
Read each quantity with its reference, units and stated conditions. A general relation does not establish a model-specific value.
| Concept / quantity | Meaning / relation | Conditions / limits |
|---|---|---|
| Rxy[m] | Σx[n+m] y*[n] | Ordered convention and support are explicit. |
| Lag m | Integer sequence shift | Its sign follows the chosen formula. |
| Physical duration | Sample-count delay × interval | Requires a common declared time basis. |
| Normalisation | Scaling of the finite sum | Centring and overlap alter interpretation. |
| Correlation peak | Pattern alignment under a convention | Not unique proof of delay or causality. |
Engineering questions.
Why is a delayed y associated with negative lag here?
Because Rxy shifts x by m while y remains the second argument.
Does reversing inputs keep the same lag sign?
Not generally; the corresponding lag direction reverses.
Does a large raw correlation prove shared variation?
No. Constant content and scaling can contribute.
Can periodic signals have several matching peaks?
Yes. Repetition can make the delay ambiguous.
Does correlation prove one signal caused the other?
No. Common influences and other relationships can explain association.
Is 0.10 seconds an actual sensor delay?
No. It belongs to the invented two-sample example.
Technical enquiry
Discuss the technical question.
Cross-correlation compares two sequences over relative shifts. Share the model and applicable operating or design information for an engineering discussion.