Using Exponential Moving Average (EMA) CPM_fast = a*CPM_instant + (1-a)*CPM_fast_old
Adaptive-Fast CPM_instant = 60.0*last_second_count; if (CPM_instant < LOW_CPM_THRESHOLD) a = 0.08; else if (CPM_instant > HIGH_CPM_THRESHOLD) a = 0.40; else a = 0.15;
Adaptive-Stable a = 0.1 CPM_instant = (5_second_count*12)