Hidscope + EMG

Dependencies:   HIDScope biquadFilter mbed

Files at this revision

API Documentation at this revision

Comitter:
Iriskolenbrander9
Date:
Mon Oct 22 11:37:53 2018 +0000
Parent:
3:76d32bcfde05
Commit message:
Filtering emg signal with highpass, lowpass and notch filters (50-250hz)

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 76d32bcfde05 -r 034f2bd0c75d main.cpp
--- a/main.cpp	Mon Oct 22 11:34:04 2018 +0000
+++ b/main.cpp	Mon Oct 22 11:37:53 2018 +0000
@@ -7,10 +7,13 @@
 Ticker      scopeTimer;
 
 BiQuadChain bqc;
-BiQuad      bq1(0.2928920553392428, 0.5857841106784856, 0.2928920553392428, -1.3007020142696517e-16,0.17156822135697122);
-BiQuad      bq2(0.9599250424722232, -1.9198500849444464, 0.9599250424722232, -1.9179540214230233, 0.9217461484658696); 
-BiQuad      bq3(0.9340059945350248, -1.84501366169642, 0.9340059945350248, -1.84501366169642, 0.8680119890700493);
-BiQuad      bq4(0.7902104553475195, -1.278587375017818, 0.7902104553475195, -1.278587375017818, 0.5804209106950391);
+BiQuad      bqlp(0.2928920553392428, 0.5857841106784856, 0.2928920553392428, -1.3007020142696517e-16,0.17156822135697122);
+BiQuad      bqhp(0.9599250424722232, -1.9198500849444464, 0.9599250424722232, -1.9179540214230233, 0.9217461484658696); 
+BiQuad      bqn50(0.9340059945350248, -1.84501366169642, 0.9340059945350248, -1.84501366169642, 0.8680119890700493);
+BiQuad      bqn100(0.8469468086519927, -1.6109885626477245, 0.8469468086519927, -1.6109885626477245, 0.6938936173039855);
+BiQuad      bqn150(0.7902067962894531, -1.4081588219037828, 0.7902067962894531, -1.4081588219037828, 0.5804135925789063);
+BiQuad      bqn200(0.7902104553475195, -1.278587375017818, 0.7902104553475195, -1.278587375017818, 0.5804209106950391);
+BiQuad      bqn250(0.7074573673408703, -1.0004958036942233, 0.7074573673408703, -1.0004958036942233, 0.4149147346817406);
 
 // Read the analog input
 AnalogIn    emg1(A0);
@@ -34,7 +37,7 @@
 int main()
 {
     // Attach the data read and send function at 100 Hz
-    bqc.add( &bq1 ).add( &bq2 ).add(&bq3).add(&bq4);
+    bqc.add( &bqlp ).add( &bqhp ).add(&bqn50).add(&bqn100).add(&bqn150).add(&bqn200).add(&bqn250);
     scopeTimer.attach_us(&scopeSend, 2e3);   
     
     while(1) { }