[maxmsp] Coder for median~?
volker böhm
vboehm at gmx.ch
Thu Jun 7 11:31:37 MDT 2007
- Previous message: [maxmsp] Coder for median~?
- Next message: [maxmsp] Would buddy override delay
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 07 Jun 2007, at 17:51, Peter McCulloch wrote: > I noticed there isn't an object to do median filtering in MSP. > Median-filtering is more expensive as an envelope follower because > it requires sorting, but it's really nice in that it's not affected > by sudden spikes in the way that average~ might. (and is really > useful as an adaptive threshold for envelope detection) > > Would anyone be interested in implementing a C++ version of a > signal-rate median filter using quicksort or some other type > algorithm? I definitely don't have the C/C++ chops to knock this > one out, but it seems like it could be particularly useful. hi, if you want something like a "running" median, you don't need a sorting algorithm. once the history array is initialized correctly, you just throw out the oldest sample value, fit in the new value where it belongs (and move all values in between) and return the middle value of the array, the median value. that's how it's done in supercollider's Median UGen. i have implemented this code in an msp object (sorry, i couln't find a maxmsp only solution ;-) ) for a project, but ended up not using it. so, it is not heavily tested, seems to work alright, though. contact me off list, if you are interested. volker.
- Previous message: [maxmsp] Coder for median~?
- Next message: [maxmsp] Would buddy override delay
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
