reduce number/data frequency

teqy's icon

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 : )

jonathanb's icon

look at the speedlim object

teqy's icon

cheers jonathanb : )

kthozoid's icon

i have found Matt Wright's 'Lbyl' object quite useful for tasks like this.
http://cnmat.berkeley.edu/downloads

Auris's icon

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?

Max Patch
Copy patch and select New From Clipboard in Max.

MIB's icon

I would look into [bucket] if I were you. there might also me a [zl] implementation for that, can't remember right now...

MIB's icon

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".

2179.MRcircBuff.zip
zip
Chris Muir's icon

An old thread where a bunch of methods are compared:
https://cycling74.com/forums/smoothing-out-numbers

Auris's icon

Thanks! Good to know them. Now I just have to pick my favourite.