Great contributions in this thread, everyone! I too have been looking through the Advanced Analysis Library, thinking that surely there's a built-in function to do such a task.
One such is MedianFilter:
AnalysisLibErrType MedianFilter (double xArray[], ssize_t numberOfXAndYElements, ssize_t leftRank, ssize_t rightRank, double y[]);
This appears to do rolling filtration on windows of data, and even has the option to replace the incoming array:
Ji = {xi–rl, xi–rl+1, ..., xi–1, xi, xi+1, ..., xi+rr–1, xi+rr},
Where rl is the left rank and rr is the right rank.
