A class for single-pole infinite impulse response filters or exponential moving average filters.  
 More...
#include <AH/Filters/EMA.hpp>
 | 
|   | EMA_f (float pole) | 
|   | Create an exponential moving average filter with a pole at the given location.  More...
  | 
|   | 
| float  | filter (float value) | 
|   | Filter the input: Given \( x[n] \), calculate \( y[n] \).  More...
  | 
|   | 
| float  | operator() (float value) | 
|   | Filter the input: Given \( x[n] \), calculate \( y[n] \).  More...
  | 
|   | 
A class for single-pole infinite impulse response filters or exponential moving average filters. 
This version uses floating point maths.
Difference equation: \( y[n] = \alpha·x[n]+(1-\alpha)·y[n-1] \) \( x \) is the input sequence, and \( y \) is the output sequence.
An in-depth explanation of the EMA filter 
Definition at line 106 of file EMA.hpp.
 
◆ EMA_f()
Create an exponential moving average filter with a pole at the given location. 
- Parameters
 - 
  
    | pole | The pole of the filter ( \(1-\alpha\)).  
 Should be a value in the range \( \left[0,1\right) \).  
 Zero means no filtering, and closer to one means more filtering.  | 
  
   
Definition at line 118 of file EMA.hpp.
 
 
◆ filter()
  
  
      
        
          | float filter  | 
          ( | 
          float  | 
          value | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Filter the input: Given \( x[n] \), calculate \( y[n] \). 
- Parameters
 - 
  
    | value | The new raw input value.  | 
  
   
- Returns
 - The new filtered output value. 
 
Definition at line 127 of file EMA.hpp.
 
 
◆ operator()()
  
  
      
        
          | float operator()  | 
          ( | 
          float  | 
          value | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Filter the input: Given \( x[n] \), calculate \( y[n] \). 
- Parameters
 - 
  
    | value | The new raw input value.  | 
  
   
- Returns
 - The new filtered output value. 
 
Definition at line 139 of file EMA.hpp.
 
 
◆ alpha
◆ filtered
The documentation for this class was generated from the following file: