EMG+filter

Dependencies:   mbed HIDScope biquadFilter biquad

Revision:
23:71103eda6fa2
Parent:
22:782e4eac9796
Child:
24:314fa9e0a4a2
--- a/main.cpp	Tue Oct 15 12:55:03 2019 +0000
+++ b/main.cpp	Tue Oct 15 13:28:03 2019 +0000
@@ -11,8 +11,9 @@
 DigitalOut  led(LED1);
 
 BiQuadChain bqc;
-BiQuad bq1(b0, b1, b2, a1, a2); //bijvoorbeeld van rechterbiceps
-BiQuad bq2(b00, b11, b22, a11, a22); //bijvoorbeeld van linkerbiceps
+BiQuad bq1(b0, b1, b2, a1, a2); //voor low-pass
+BiQuad bq2(b00, b11, b22, a11, a22); // voor high-pass
+BiQuad bq3(b000, b111, b222, a111, a222); //notch -> voor coëfficienten, zie matlab
 
 Ticker emgSampleTicker;
 AnalogIn emg(A0); //kloptA0 wel??
@@ -43,15 +44,13 @@
 }
 
 
-
-
 int main()
 {   
     /**Attach the 'sample' function to the timer 'sample_timer'.
     * this ensures that 'sample' is executed every... 0.002 seconds = 500 Hz
     */
     sample_timer.attach(&sample, 0.002f);
-    bqc.add(&bq1).add(&bq2);
+    bqc.add(&bq1).add(&bq2).add(&bq3);
     emgSampleTicker.attach(&emgSample,0.01);
 
     /*empty loop, sample() is executed periodically*/