How does Correlation for 1D Signals work?
For the simple $3$-tap filter given in the example, each output value $r(j)$ is computed as
$$\begin{align}r(j)&amp;=f(-1)I(j-1)+f(0)I(j)+f(1)I(j+1)\\&amp;=-\frac12 I(j-1)+\frac12 I(j+1)\tag{1}\end{align}$$
So each input value is replaced by the (scaled) difference between its neighboring values.