I want to find the local maxima in the function $x$. I want to do it by applying a moving maximum filter to x. Then the position at which the function x is equal to the outp