Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HIDScope MODSERIAL QEI TextLCD mbed
Fork of TotalControlEmg2 by
Diff: main.cpp
- Revision:
- 1:98be4152a539
- Parent:
- 0:557b1ff83a8a
- Child:
- 2:ae55928ff00f
diff -r 557b1ff83a8a -r 98be4152a539 main.cpp
--- a/main.cpp Tue Oct 06 12:02:22 2015 +0000
+++ b/main.cpp Tue Oct 06 12:07:40 2015 +0000
@@ -10,8 +10,8 @@
// constante variabelen:
//Sample frequentie
-Fs = 500; //Hz
-t = 1/ Fs; // voor EMGticker
+double Fs = 500; //Hz
+double t = 1/ Fs; // voor EMGticker
// Filter1a: 50Hz Notch
double v1_50a = 0, v2_50a = 0;
@@ -45,17 +45,17 @@
// Filter(double u, double &v1, double &v2, const double a1, const double a2, const double b0, const double b1, const double b2)
// 50Hz Notch filter
- double y50a = double Filter(u, v1_50a, v2_50a, a1_50a, a2_50a, b0_50a, b1_50a, b2_50a);
- double y50b = double Filter(y50a, v1_50b, v2_50b, a1_50b, a2_50b, b0_50b, b1_50b, b2_50b);
+ double y50a = Filter(u, v1_50a, v2_50a, a1_50a, a2_50a, b0_50a, b1_50a, b2_50a);
+ double y50b = Filter(y50a, v1_50b, v2_50b, a1_50b, a2_50b, b0_50b, b1_50b, b2_50b);
// High Pass filter. Tot 20Hz wordt weggefliterd
- double yHP = double Filter(y50b, v1_HP, v2_HP, a1_HP, a2_HP, b0_HP, b1_HP, b2_HP);
+ double yHP = Filter(y50b, v1_HP, v2_HP, a1_HP, a2_HP, b0_HP, b1_HP, b2_HP);
// Absolute waarde wordt genomen.
double y1 = fabs(yHP);
// Low Pass filter. Alles vanaf 5Hz wordt weggefilterd
- double yLP = double Filter(y1, v1_LP, v2_LP, a1_LP, a2_LP, b0_LP, b1_LP, b2_LP);
+ double yLP = Filter(y1, v1_LP, v2_LP, a1_LP, a2_LP, b0_LP, b1_LP, b2_LP);
double y = yLP;
@@ -67,7 +67,7 @@
int main(){
- EMGticker.attach(&EMGfilter, t) //500Hz
+ EMGticker.attach(&EMGfilter, t); //500Hz
while(1){}
}
\ No newline at end of file
