I am looking for a Python function that can implement the functionality of movmin
. I have included the Matlab description of movmin
below.
M = movmin(A,k)
returns an array of localk
-point centered minimum values, where each minimum is calculated over a sliding window of lengthk
across neighboring elements ofA
. Whenk
is odd, the window is centered about the element in the current position. Whenk
is even, the window is centered about the current and previous elements. The window size is automatically truncated at the endpoints when there are not enough elements to fill the window. When the window is truncated, the minimum is taken over only the elements that fill the window.M
is the same size asA
.If
A
is a vector, thenmovmin
operates along the length of the vector.If
A
is a multidimensional array, thenmovmin
operates along the first array dimension whose size does not equal 1.
My input is a multi-dimensional array.