title: Rolling median in C - Turlach implementation
body: <p>Does anyone know if there is a clean implementation of the Turlach rolling median algorithm in C?  I'm having trouble porting the R version to a clean C version.  See <a href="https://stackoverflow.com/questions/1309263/rolling-median-algorithm-in-c">here</a> for more details on the algorithm.</p>
  
  <p><strong>EDIT:</strong>
  As darkcminor pointed out, matlab has a function <code>medfilt2</code> which calls <code>ordf</code> which is a c implementation of a rolling order statistic algorithm.  I believe the algorithm is faster than O(n^2), but it is not open source and I do not want to purchase the image processing toolbox.</p>