HuntsvilleEngineers mark

Cross-Correlation Peak Lag

Find the time delay between two sampled signals from the lag of their cross-correlation peak.

Inputτ = k* / fₛ , k* = argmaxₖ Rₓᵧ(k) Δd = c · τ

Your recent runs (stored only in your browser)

No calculations yet — results land here so you can compare runs.

The engineering

The cross-correlation Rₓᵧ(k) slides one signal against another and measures overlap at each integer lag k; the lag k* where it peaks is the sample offset that best aligns them. Divide by the sample rate and you have the physical time delay τ — the workhorse behind TDOA localization, sonar/radar ranging, and syncing DAQ channels that share no common trigger.

The catch is resolution: peak lag is quantized to whole samples, so your finest delay step is 1/fₛ. For sub-sample delay, fit a parabola to the three points around the peak, or upsample first. Also confirm the correlation actually has one dominant peak — periodic signals give ambiguous combs, and low SNR smears the peak into the noise floor.

Where this math comes from

Correlation analysis grew out of Norbert Wiener's 1930 work on generalized harmonic analysis, which tied the autocorrelation of a signal to its power spectrum. Engineers seized on the cross-correlation form during and after WWII for radar and sonar, where the lag of the peak directly gives round-trip or arrival-time delays.

Julius Bendat and Allan Piersol codified the practical estimator for working engineers in their 1966 book Measurement and Analysis of Random Data, which became the standard bench reference for turning sampled records into correlation and spectral estimates. Their treatment of finite-record bias and confidence is why the method is trusted on real DAQ data, not just textbook math.

  1. 1930Norbert WienerFormalizes autocorrelation and its link to the power spectrum.
  2. 1949Wiener / LeeCorrelation methods applied to signal detection and delay estimation in noise.
  3. 1966Bendat & PiersolPublish the standard engineering treatment of cross-correlation on random data.
  4. 1976Knapp & CarterGeneralized cross-correlation (GCC-PHAT) sharpens time-delay peaks for TDOA.

See the full timeline of the math behind every calculator →

Runs entirely in your browser — nothing you enter leaves this page. Your recent runs are stored only on your device.