Highpass en Notch filter voor EMG verwerking

Dependencies:   HIDScope mbed-dsp mbed

Fork of EMG_HIDScope by First Last

Revision:
17:1388f1a2d7b2
Parent:
16:24e992616cf6
Child:
18:fed07cc1f8f6
--- a/main.cpp	Wed Sep 24 08:31:30 2014 +0000
+++ b/main.cpp	Wed Sep 24 12:21:00 2014 +0000
@@ -23,8 +23,9 @@
 
 //constants
 second_order_constants_t highpass= {{0.97803048, -1.95606096,  0.97803048},{1, -1.95557824,  0.95654368}};
+second_order_constants_t lowpass={{ 0.02008337 , 0.04016673 , 0.02008337},{1.0,         -1.56101808,  0.64135154}};
 //type for values
-second_order_values_t highpass_values;
+second_order_values_t highpass_values, lowpass_values;
 
 float second_order(float x, second_order_constants_t constants, second_order_values_t &values);
 
@@ -54,7 +55,7 @@
     /*send value to PC. Line below is used to prevent buffer overrun */
 
     scope.set(0,emg_value);
-    scope.set(1,filtered_emg);
+    scope.set(1,second_order(fabs(filtered_emg), lowpass, lowpass_values));
     scope.send();
 
     /**When not using the LED, the above could also have been done this way: