Moving medians are implemented in the Wolfram Language as MovingMedian[data, n].
Moving Median
See also
Moving AverageCite this as:
Weisstein, Eric W. "Moving Median." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/MovingMedian.html