Avg or sum all in a COLL

    Sep 10 2013 | 1:27 am
    so I have a Coll set up to take in indexs up to 50 and then delete index 1, move all indexes down, and add to 50 essentially giving me a constantly changing 50 indexed list. This is for a computer vision project and I am looking to smooth out the blob x/y coord so this was a way I thought to implement it. Basically is there an efficient way to sum all values in a coll and bang that to the output? Is Coll the right tool to be using here?

    • Sep 10 2013 | 2:39 am
      I don't know that taking the average of the last 50 values is the best formula for a smoothing filter :), but if you do want to do that, the table object might be your best bet.
    • Sep 12 2013 | 7:16 am
      Alternatively, use zl.stream 50 to create a running list.
      Vexpr does math on lists if you need anything fancy, though you can calculate the mean with the mean object, or the median with zl.median.
    • Sep 12 2013 | 7:31 am
      yeah, [zl stream 50], [zl sum], [zl median].