Prius IPM controller

Dependencies:   mbed

Fork of analoghalls5_5 by N K

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers filters.cpp Source File

filters.cpp

00001 #include "includes.h"
00002 #include "filters.h"
00003 
00004 MeanFilter::MeanFilter(float strength) {
00005     _strength = strength;
00006     _mean = 0;
00007 }
00008 
00009 float MeanFilter::Update(float x) {
00010     return _mean = _strength * _mean + (1.0f - _strength) * x;
00011 }