SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
Util.cpp File Reference

Util source file. More...

#include "Util.h"

Go to the source code of this file.

Functions

double EMAvg (double lastVal, double newVal, int memCount)
 Exponential moving average.
 

Detailed Description

Util source file.

Author
IR
Version
0.1
Date
2022-01-07

Definition in file Util.cpp.

Function Documentation

◆ EMAvg()

double EMAvg ( double  lastVal,
double  newVal,
int  memCount 
)

Exponential moving average.

Parameters
lastValThe last value that was returned
newValThe new value that should be added to the average
memCountThe total number of samples to be averaged
Returns
double The EMA of the last memCount values

Definition at line 14 of file Util.cpp.