[PD] d-median (a running median) + d-for (a for loop)

Frank Barknecht fbar at footils.org
Fri Oct 17 14:25:43 CEST 2008


Hallo,
Damian Stewart hat gesagt: // Damian Stewart wrote:

> here's [d-median], a 'running median' abstraction i put together today. 
> it's pure-Pd, for your PDa/Palmpilot/iPhoning pleasure. it outlets a 
> running median of the last n values sent to its inlet.
> 
> internally, it maintains two arrays - one a sorted list of values, the 
> other a table of the timetags associated with each value. when you pass it 
> a new value it increments the current timetag, finds the 'oldest' value in 
> the list (the value with the current timetag) and removes it, and inserts 
> the new value in-order, attaching the current timetag. this is implemented 
> as a single pass through the array, doing the smallest number of copies 
> possible, so it's fairly efficient.

That's really useful! 

But I had a *really* hard time to read your patch. Attached is a
slightly cleaned up version with some added local sends and many cord
crossings removed. Still not perfect, but now I can see more of all
these objects. ;)

Ciao
-- 
 Frank Barknecht            Do You RjDj.me?          _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d-median.pd
Type: application/puredata
Size: 8613 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20081017/6d5665e8/attachment.bin>


More information about the Pd-list mailing list