Motor Evaluation Kit NEVC-MCTRL-100-t01-1.0.0
Firmware for NEVB-MCTRL-100-01 for trapezoidal control of BLDC motors using Hall-effect sensors
|
Filter source file. More...
#include "filter.h"
Go to the source code of this file.
Functions | |
int16_t | calculateEMA (uint16_t currentSample, uint16_t previousEMA, uint8_t alphaExponent) |
Exponential Moving Average (EMA) calculation algorithm. | |
Filter source file.
This file contains the exponential moving average (EMA) filter implementation.
Definition in file filter.cpp.
int16_t calculateEMA | ( | uint16_t | currentSample, |
uint16_t | previousEMA, | ||
uint8_t | alphaExponent ) |
Exponential Moving Average (EMA) calculation algorithm.
Calculates EMA from current sample, previous EMA and alpha.
currentSample | Current measured sampled. |
previousEMA | Previously calculated EMA. |
alphaExponent | Used to drive alpha where alpha = 1 / (2 ^ alphaExponent). |
Definition at line 34 of file filter.cpp.