Cross-Correlation Calculator — Find the Lag Between Two Sensor Series
Choose two channels. You get the cross-correlation function across the lags you asked for, the lag of the strongest correlation, and significance bounds — which is how you find out that leaf wetness follows relative humidity by about two hours rather than assuming it.
Your data
Drop a logger CSV here
HOBOware and Postlad exports are recognised automatically. It is read on this machine — nothing is uploaded.
Synthetic twelve-day record at half-hourly intervals: air temperature and soil temperature at 10 cm depth, where the soil is a damped copy of the air delayed by exactly three hours — the thermal lag the tool should recover as lag −6. The soil probe drops out for three hours on the fifth day, so the pairwise handling of missing readings is visible. Not measured data.
SVG is vector — scale it to any size in Illustrator, Inkscape or LaTeX without losing quality, and edit the type. Use it unless a journal insists on raster.
Options
Series
Lag k is the correlation between this channel at t+k and the second at t.
The figure says in words which channel leads, so the order cannot mislead you.
Both channels are averaged onto this regular grid first. A lag is one step of it — cross-correlating irregular timestamps has no defined lag.
Lags
Automatic uses a quarter of the series, capped at 48 steps either way.
The CCF scales every lag by the whole series, so r shrinks as the overlap does — it is what R, Minitab and every textbook print. Pearson rescales to the overlapping window at each lag instead, which does not shrink and is easier to over-read at large lags.
Figure
All of that was worked out in this browser tab. Your file was not uploaded, and no request goes out while you work — open the network panel and watch, if you like.