HL Generatoren mit Tiefpass
Revision 0:1ee433748336, committed 2017-05-09
- Comitter:
- ogris
- Date:
- Tue May 09 06:59:27 2017 +0000
- Commit message:
- SDFWERWREW
Changed in this revision
TP1Ord_V3.cpp | Show annotated file Show diff for this revision Revisions of this file |
TP1Ord_V3.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TP1Ord_V3.cpp Tue May 09 06:59:27 2017 +0000 @@ -0,0 +1,24 @@ + +#include "TP1Ord_V3.h" + +TP1Ord::TP1Ord() +{ + // vern�nftige Grenzfrequenz setzen + SetAlpha(0.1); +} + + +void TP1Ord::SetAlpha(float aAlpha) +{ + _alpha=aAlpha; + _beta = 1.0-aAlpha; +} +void TP1Ord::CalcOneStep(float aX){ + y = aX * _alpha + y * _beta; +} + + + + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TP1Ord_V3.h Tue May 09 06:59:27 2017 +0000 @@ -0,0 +1,22 @@ + +#ifndef TP1Ord_V3_h +#define TP1Ord_V3_h + + +class TP1Ord { + public: + float y; // Ausgangswert des Filters + private: + float _alpha, _beta; // Koeffizienten f�r die Grenzfrequenz + public: + TP1Ord(); + + void SetAlpha(float aAlpha); + + void CalcOneStep(float aX); +}; + +#endif + + +