Finding where signal is showing some (unknown) periodicity
If you're gonna use ASDF to measure periodicity and you want to window the data with something other than rectangular window, do it after subtracting and squaring:

$$ Q_x[k, n_0] \triangleq \frac{2}{N} \sum\limits_{n=0}^{N-1} \left(x[n+n_0-\left\lfloor \tfrac{N+k}{2}\right\rfloor] \ - \ x[n+n_0-\left\lfloor \tfrac{N+k}{2}\right\rfloor + k] \right)^2 w\left(\tfrac{n}{N}\right) $$

where

$\left\lfloor \cdot \right\rfloor$ is the floor() function and, if $k$ is even then $ \left\lfloor \frac{k}{2}\right\rfloor = \left\lfloor \frac{k+1}{2}\right\rfloor = \frac{k}{2} $

and $w\left(\tfrac{n}{N}\right)$ is a window function of non-zero width $N$ samples centered at $n=\tfrac{N}{2}$.  A Hann window would be

$$ w(u) \triangleq \begin{cases}
\tfrac12 - \tfrac12 \cos(2\pi u) \qquad &amp; 0 \le u &lt; 1 \\
\\
0 &amp; \text{otherwise} \\ 
\end{cases}$$

To make this ASDF into "autocorrelation" (in the neighborhood of sample $x[n_0]$) defined from the ASDF:

$$ R_x[k,n_0] = R_x[0,n_0] - \tfrac12 Q_x[k, n_0]  $$

where 

$$ R_x[0, n_0] \triangleq \frac{2}{N} \sum\limits_{n=0}^{N-1} \Big(x[n+n_0-\left\lfloor \tfrac{N}{2}\right\rfloor]\Big)^2 w\left(\tfrac{n}{N}\right) $$

Since $Q_x[0, n_0] = 0$ and $Q_x[k, n_0] \ge 0$ for all lags $k$, that means that $ R_x[k, n_0] \le R_x[0, n_0] $ for all lags $k$.

Suppose for a minute that $x[n]$ is periodic with period $P$ (and $P$ happens to be an integer), then

$$ x[n+P] = x[n] \quad \forall n $$

and  $Q_x[mP, n_0] = 0$ and $R_x[mP, n_0] = R_x[0, n_0] \ge R_x[k, n_0]$ for any integer number of periods ($m$ is an integer).  So you get a peak at $k=0$ and at $k$ equal to any other multiple of $P$ if $x[n]$ is periodic.  If $x[n]$ is not perfectly periodic, what we might expect is the biggest peak at $k=0$, another peak (but slightly smaller) at $k=P$ (the period we are looking for) and progressively smaller peaks for larger multiples of $P$.

The measure of periodicity in the neighborhood of $n_0$ would be

$$\frac{R_x[P, n_0]}{R_x[0, n_0]}$$

Hmmm, I just thought of something.  Because of my audio/music-centric POV, I have been assuming no DC bias (i.e. $x[n]$ should maybe come out of a DC blocking high-pass filter).  But I don't think that is the case with your application.  So maybe just stick with ASDF, but somewhere you will need a threshold for how low $Q_x[k, n_0]$ can go (for $k \ne 0$) for you to consider that $x[n]$ is periodic in the neighborhood of $n_0$.