Let $\mathbf{v}(\mathbf{r})=[v_x(\mathbf{r}), v_y(\mathbf{r})]^T$ be a velocity vector at a point $\mathbf{r}=[r_x,r_y]^T$. Suppose we have a set of discrete samples of such velocity vectors at $N\times N$ sampling points like shown in the image below:
I want to find the correlation of two points, that is, an ensemble average of the inner product of two vectors separated by a distance $\Delta r$: $$ R(\Delta r) = \langle\mathbf{v}(\mathbf{r_1})\cdot\mathbf{v}(\mathbf{r_2}) \rangle \tag{1} $$ where $\Delta r = |\mathbf{r_1}-\mathbf{r_2}|$.
I am wondering how to compute this correlation as efficiently as possible. The most brute-force method is to compute the inner product with every possible combination of vectors and average all the results. However, I think there should be a smarter way. For example, for a continuous case, one definition of correlation is
$$
R_{fg}(\Delta r) = f(\mathbf{r})\ast g(\mathbf{r}) = \int_{-\infty}^{\infty} f(\mathbf{r})g^{\ast}(r-\Delta r) d\mathbf{r}
$$
and this can be rewritten as
$$
f(\mathbf{x})\ast g(\mathbf{x}) =\mathcal{F}^{-1}\{\mathcal{F}[f(x)]\mathcal{F}[g(x)]^{\ast} \}
$$
where $\mathcal{F}$ is a Fourier transform and $\mathcal{F}^{-1}$ is an inverse Fourier transform. However, the definition of the "correlation" looks a bit different to me, and I'm not sure I can use this relationship to compute eq.(1).
