ya kno it

Dependencies:   Filters

Files at this revision

API Documentation at this revision

Comitter:
Thijs12va
Date:
Tue Oct 31 09:42:15 2017 +0000
Parent:
2:02d31a0caac1
Commit message:
l

Changed in this revision

emg.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 02d31a0caac1 -r cd11e6e02817 emg.cpp
--- a/emg.cpp	Fri Oct 27 12:49:11 2017 +0000
+++ b/emg.cpp	Tue Oct 31 09:42:15 2017 +0000
@@ -5,11 +5,11 @@
     float Ts = 1/fs;
     float fc = 9.0;  
     highpass.a= 1/(2*3.1415*Ts*fc +1);                                // filter coefficient of high-pass filter
-    float lambda= 51.6    *2.0*3.1415;                    // 50 Hz notch filter frequency in rad/s (Hz*2*pi)
+    float lambda= 51.7126    *2.0*3.1415;                    // 50 Hz notch filter frequency in rad/s (Hz*2*pi)
     float b= 4.0          *2.0*3.1415;                    // 50 Hz notch filter bandwidth in rad/s (Hz*2*pi)
     notch50.lambda = lambda/(2.0*fs);               // scaling for the 2/T multiplication which happens in the transform from s-domain to z-domain
     notch50.b = b/(2.0*fs);                         // scaling for the 2/T multiplication which happens in the transform from s-domain to z-domain
-    float lambda2=103.2   *2.0*3.1415;                    // 100 Hz notch filter frequency in rad/s (Hz*2*pi)
+    float lambda2=115.6328   *2.0*3.1415;                    // 100 Hz notch filter frequency in rad/s (Hz*2*pi)
     float b2= 4.0         *2.0*3.1415;                    // 100 Hz notch filter frequency in rad/s (Hz*2*pi)
     notch100.lambda = lambda2/(2.0*fs);             // scaling for the 2/T multiplication which happens in the transform from s-domain to z-domain
     notch100.b = b2   /(2.0*fs);                    // scaling for the 2/T multiplication which happens in the transform from s-domain to z-domain
@@ -28,6 +28,7 @@
     float raw_data = emg_in.read();                           // obtain raw EMG data
     
     float emg_notch = notch50.filter(raw_data);               // notch filter to filter out the noise (especially from laptop charger)
+    emg_notch = notch100.filter(emg_notch);
     
     float emg_hp = highpass.filter(emg_notch);              // high-pass filter