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:
- 3:344b173f85fe
- Parent:
- 2:ae55928ff00f
- Child:
- 4:3b9e2d49d5fb
diff -r ae55928ff00f -r 344b173f85fe main.cpp --- a/main.cpp Tue Oct 06 12:19:27 2015 +0000 +++ b/main.cpp Tue Oct 06 13:18:52 2015 +0000 @@ -13,6 +13,7 @@ double Fs = 500; //Hz double t = 1/ Fs; // voor EMGticker + // Filter1a: 50Hz Notch double v1_50a = 0, v2_50a = 0; const double a1_50a = -1.61803398875, a2_50a = 1.00000000000; @@ -25,6 +26,7 @@ const double b0_50b = 1.00000000000, b1_50b = -1.61803398875, b2_50b = 1.00000000000; const double gain_50b = 1.000000; + // Filter1: 20Hz HighPass double v1_HP = 0, v2_HP = 0; const double a1_HP = -0.76475499450, a2_HP = 0.27692273367; @@ -49,7 +51,7 @@ // 50Hz Notch filter double y50a = Filter(u, v1_50a, v2_50a, a1_50a, a2_50a, b0_50a, b1_50a, b2_50a, gain_50a); - double y50b = Filter(y50a, v1_50b, v2_50b, a1_50b, a2_50b, b0_50b, b1_50b, b2_50b, gain_50a); + double y50b = Filter(y50a, v1_50b, v2_50b, a1_50b, a2_50b, b0_50b, b1_50b, b2_50b, gain_50b); // High Pass filter. Tot 20Hz wordt weggefliterd double yHP = Filter(y50b, v1_HP, v2_HP, a1_HP, a2_HP, b0_HP, b1_HP, b2_HP, gain_HP); @@ -60,7 +62,7 @@ // Low Pass filter. Alles vanaf 5Hz wordt weggefilterd double yLP = Filter(y1, v1_LP, v2_LP, a1_LP, a2_LP, b0_LP, b1_LP, b2_LP, gain_LP); - double y = yLP; + double y = 10 * yLP; // Plotten in HIDscope scope.set(0,u); //ongefilterde waarde naar scope 1