Skip to content

Commit

Permalink
Fix ewma
Browse files Browse the repository at this point in the history
  • Loading branch information
FredM67 committed Mar 9, 2024
1 parent 16e5ba4 commit 5aa1365
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mk2_3phase_RFdatalog_temp/ewma_avg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ class EWMA_average
void addValue(int32_t input)
{
ema_raw = ema_raw - ema + input;
ema = ema_raw >> round_up_to_power_of_2(A);
ema = ema_raw >> (round_up_to_power_of_2(A) - 1);

ema_ema_raw = ema_ema_raw - ema_ema + ema;
ema_ema = ema_ema_raw >> round_up_to_power_of_2(A);
ema_ema = ema_ema_raw >> (round_up_to_power_of_2(A) - 1);
}

auto getAverageS() const
Expand Down

0 comments on commit 5aa1365

Please sign in to comment.