Suppose I have two timeseries $x_1(t)$ and $x_2(t)$, shown in the image that I drew below. They look almost identical in general form, except some features are shifted slightly in time from one series to the other by an about $\delta t$. Sometimes they are measured first in $x_1$, and sometimes in $x_2$, so sometimes $\delta t$ is positive and sometimes negative. The change in lag between features is random, but constrained to be of a small range so that shifts never overlap and cancel.
I want to know, what is the mean time lag between the two signals?
Even better, would be to know the distribution of time lags so I could estimate the mean, variance and range.
Does anyone have ideas or suggestions for how to do this?
My own thoughts so far are: I can imagine calculating the cross correlation between signals $x_1$ and $x_2$. However, I would expect the result to be strong correlation at zero time lag, because the time lags can be both positive and negative, so that the average lag is zero. However, the width/stretching of the zero peak, must be related to the average time lag, however, I can't figure out how exactly at the moment.
Another thought I have had is to create a moving correlation estimator. In a similar way to how wavelet analysis can be used to estimate how the power of certain frequency components changes as a function of time. I could develop a function that measures the lag correlation as a function of time by breaking one of the signals into smaller chunks and convolving it across the second signal while stepping along.
All suggestions appreciated.