:)

Dependencies:   HIDScope MODSERIAL mbed-dsp mbed

Fork of emg_filter by Tanja H

Files at this revision

API Documentation at this revision

Comitter:
Tanja2211
Date:
Fri Oct 17 10:52:54 2014 +0000
Parent:
30:5d8e6f0fabc1
Child:
32:1bc34d137942
Commit message:
MAF Triceps

Changed in this revision

EMGfilter.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/EMGfilter.cpp	Fri Oct 17 10:36:29 2014 +0000
+++ b/EMGfilter.cpp	Fri Oct 17 10:52:54 2014 +0000
@@ -117,6 +117,21 @@
 
         return MOVAVG_B;
     }
+     MAF::MAF() {}
+    float MAF::update(float filtered_emgT) {
+        T[0]=filtered_emgT;
+        MOVAVG_T=T[0]*0.1+T[1]*0.1+T[2]*0.1+T[3]*0.1+T[4]*0.1+T[5]*0.1+T[7]*0.1+T[8]*0.1+T[9]*0.1
+        T[9]=T[8];
+        T[8]=T[7];
+        T[7]=T[6];
+        T[6]=T[5];
+        T[5]=T[4];
+        T[4]=T[3];
+        T[3]=T[2];
+        T[2]=T[1];
+        T[1]=T[0];
+
+        return MOVAVG_T;
 }
 
 void looperT()