![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Non-variable (TESTEDandWORKING)
Fork of ELEC347_Coursework by
Diff: Filter.cpp
- Revision:
- 13:db76473a3d76
- Parent:
- 11:7efb6e4759cc
diff -r d522a7a061d6 -r db76473a3d76 Filter.cpp --- a/Filter.cpp Sat Dec 02 17:09:34 2017 +0000 +++ b/Filter.cpp Mon Dec 04 11:24:15 2017 +0000 @@ -98,6 +98,25 @@ printf("Den 2 = %f\t", _a1); printf("Den 3 = %f\n\r", _a2); } +void FILTER::coeff_update(float _Fo_Current,float _Boost_Current,float _Q_Current) +{ + + + if (abs(_Fo_Current - _Fo) > 50) //If Centre Frequency has changed significantly + { + _Fo = _Fo_Current; + } + if (abs(_Boost_Current - _Boost) > 2) //If Boost has changed significantly + { + _Boost = _Boost_Current; + } + if (abs(_Q_Current - _Q) > 2) //If Q has changed significantly + { + _Q = _Q_Current; + } + + Define_Filter(); +} void FILTER::Update_Fo(int Fo_New){_Fo = Fo_New;} int FILTER::Get_Fo(){return _Fo;}