V001. 2017_11_30 10:21 Working code from Tuesday's lab session.

Dependencies:   mbed-rtos mbed

Fork of 2017_11_28_ELEC347_Coursework by Chris Hills

DSP Coursework ELEC347 2017-2018 Group members: Matthew Thewsey, Thomas Morris, Samuel Waggett, Christopher Hills .

Revision:
13:db76473a3d76
Parent:
11:7efb6e4759cc
--- 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;}