reduce number/data frequency


    Mar 17 2011 | 12:38 am
    hi
    I am wondering what is the best way to reduce a random stream of 0's & 1's if numbers are arriving at a number box very quickly? 1,0,0,0,0,1,1,1,0,1,1,0
    is there an efficient way to filter out perhpas single number in every 3 or 4 numbers? Would a counter and a gate be a good idea? or is there a purpose built module for this perhaps? I tried (change) but sometimes only '0' is sent and therefore nothing is sent for until a 1 arrives.
    the reason I ask is that i am sending these 1's and 0's to a serial module and my arduino is not keen. I have everything set too 115200, but it gets clogged up real easy : / So I thought best to reduce the flow.
    thanks : )

    • Mar 17 2011 | 12:42 am
      look at the speedlim object
    • Mar 17 2011 | 12:49 am
      cheers jonathanb : )
    • Mar 17 2011 | 8:34 am
      i have found Matt Wright's 'Lbyl' object quite useful for tasks like this. http://cnmat.berkeley.edu/downloads
    • May 03 2011 | 7:34 pm
      I have a device that produces numbers from 0 to 4095 and they're very jumpy, so I do this kind of averaging. Anyone better solution?
    • May 03 2011 | 7:42 pm
      I would look into [bucket] if I were you. there might also me a [zl] implementation for that, can't remember right now...
    • May 03 2011 | 7:46 pm
      here is an old abstraction that implements a circular buffer type thing. have a look, might be useful to you. in particular look at the helpfile under "mean-example".
    • May 03 2011 | 7:49 pm
      An old thread where a bunch of methods are compared: https://cycling74.com/forums/smoothing-out-numbers
    • May 03 2011 | 9:37 pm
      Thanks! Good to know them. Now I just have to pick my favourite.