I want to maintain moving averages over a window without keeping individual elements in that window. A simple way to do it?
double approxRunningAverage (double avgres, double new_measurement) {
avgres -= avgres / N;
avgres += new_measurement / N;
return avgres;
}