Calculate rolling / moving average in c or c++

Posted by Biohazard on Stack Overflow See other posts from Stack Overflow or by Biohazard
Published on 2012-06-12T04:38:09Z Indexed on 2012/06/12 4:39 UTC
Read the original article Hit count: 181

Filed under:
|
|
|

I know this is achievable with boost as per:

Using boost::accumulators, how can I reset a rolling window size, does it keep extra history?

But I really would like to avoid using boost. I have googled and not found any suitable or readable examples.

Basically I want to track the moving average of an ongoing stream of a stream of floating point numbers using the most recent 1000 numbers as a data sample.

What is the easiest way to achieve this?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c