rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
ExpAverage Class Reference

#include <exp_average.h>

Collaboration diagram for ExpAverage:
Collaboration graph
[legend]

Public Member Functions

float initOrAverage (float value)
 
float average (float value)
 
void init (int length)
 
void setSmoothingFactor (float p_smoothingFactor)
 
void reset ()
 

Private Attributes

float current = 0
 
float smoothingFactor = 0.5
 

Detailed Description

Definition at line 7 of file exp_average.h.

Member Function Documentation

◆ average()

float ExpAverage::average ( float  value)
inline

Definition at line 17 of file exp_average.h.

17 {
19 return current;
20 }
float smoothingFactor
Definition exp_average.h:37
float current
Definition exp_average.h:36

Referenced by initOrAverage().

Here is the caller graph for this function:

◆ init()

void ExpAverage::init ( int  length)
inline

Definition at line 22 of file exp_average.h.

22 {
23 setSmoothingFactor(2 / (length + 1.0));
24 }
void setSmoothingFactor(float p_smoothingFactor)
Definition exp_average.h:26
Here is the call graph for this function:

◆ initOrAverage()

float ExpAverage::initOrAverage ( float  value)
inline

Definition at line 9 of file exp_average.h.

9 {
10 if (current == 0) {
11 current = value;
12 return current;
13 }
14 return average(value);
15 }
float average(float value)
Definition exp_average.h:17

Referenced by filterMapValue(), getAfr(), initTps(), and AemXSeriesWideband::refreshSmoothedLambda().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void ExpAverage::reset ( )
inline

Definition at line 30 of file exp_average.h.

30 {
31 current = 0;
32 smoothingFactor = 0.5;
33 }

◆ setSmoothingFactor()

void ExpAverage::setSmoothingFactor ( float  p_smoothingFactor)
inline

Definition at line 26 of file exp_average.h.

26 {
27 smoothingFactor = p_smoothingFactor;
28 }

Referenced by filterMapValue(), getAfr(), init(), initTps(), and AemXSeriesWideband::refreshSmoothedLambda().

Here is the caller graph for this function:

Field Documentation

◆ current

float ExpAverage::current = 0
private

Definition at line 36 of file exp_average.h.

Referenced by average(), initOrAverage(), and reset().

◆ smoothingFactor

float ExpAverage::smoothingFactor = 0.5
private

Definition at line 37 of file exp_average.h.

Referenced by average(), reset(), and setSmoothingFactor().


The documentation for this class was generated from the following file: