Script to plot both a raw EMG signal and the filtered signal in HIDscope

Dependencies:   HIDScope mbed

Revision:
4:d32946ab9c54
Parent:
3:7cb317c00afb
Child:
5:cf85007ce40a
--- a/main.cpp	Mon Oct 26 15:49:35 2015 +0000
+++ b/main.cpp	Mon Oct 26 16:10:02 2015 +0000
@@ -3,6 +3,7 @@
 //included for fabs() function
 #include <math.h>
 #include "HIDScope.h"
+#include <iostream>
 
 Ticker sample_timer;
 HIDScope scope(2);
@@ -172,6 +173,7 @@
 void sample()
 {
     input = analog_emg_left.read();
+    input = input-0.45; //FIRST SUBTRACT MEAN THEN FILTER
     //input_right = analog_emg_right.read();
     filter_signal = filter(input, v1, v2);
     //filter_right = filter(input_right, v1_right, v2_right);