$search
00001 00002 00003 #ifndef _TRACKING_SMOOTH_FILTER_ 00004 #define _TRACKING_SMOOTH_FILTER_ 00005 00006 00007 namespace Tracking{ 00008 00009 class SmoothFilter 00010 { 00011 public: 00012 SmoothFilter(){ a = 0.0f; b = 1.f - a; z = 0; }; 00013 SmoothFilter(float a){ this->a = a; b = 1.f - a; z = 0; }; 00014 inline float Process(float in) { z = (in * b) + (z * a); return z; } 00015 inline void Set(const float &z) { this->z = z; } 00016 inline void Set(const float &z, float delay) { this->z = z; a = delay; b = 1.f - delay; } 00017 inline void SetDelay(float d) { a = d; b = 1.f- d; } 00018 private: 00019 float a, b, z; 00020 }; 00021 00022 00023 } 00024 00025 #endif