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: Filterdesigns.cpp
- Revision:
- 41:91c8c39d7a33
- Parent:
- 30:8ae855348d22
- Child:
- 50:16314b798754
--- a/Filterdesigns.cpp Wed Oct 21 14:17:22 2015 +0000 +++ b/Filterdesigns.cpp Thu Oct 22 08:07:27 2015 +0000 @@ -5,8 +5,8 @@ //Notch 50Hz // Filter1a: 50Hz Notch -double v1_50a_L = 0, v2_50a_L = 0; -double v1_50a_R = 0, v2_50a_R = 0; +double v1_50a_L = 0, v2_50a_L = 0; // Left EMG memory +double v1_50a_R = 0, v2_50a_R = 0; // Right EMG memory const double a1_50a = -1.52337295428, a2_50a = 0.93195385841; const double b0_50a = 1.00000000000, b1_50a = -1.61854514929, b2_50a = 1.0; const double gain_50a = 1.000000; @@ -37,7 +37,7 @@ const double gain_LP = 0.000511; - +// Filter with memory values left EMG double FilterdesignsLeft(double u){ // input u, oude y waarde double y = 0; //u = input waarde @@ -62,7 +62,8 @@ y = 10 * yLP; return y; } - + +// Filter with memory values left EMG double FilterdesignsRight(double u){ // input u, oude y waarde //u = input waarde //y = output waarde @@ -74,8 +75,8 @@ double y50a = Filter(u, v1_50a_R, v2_50a_R, a1_50a, a2_50a, b0_50a, b1_50a, b2_50a, gain_50a); double y50b = Filter(y50a, v1_50b_R, v2_50b_R, a1_50b, a2_50b, b0_50b, b1_50b, b2_50b, gain_50b); - // High Pass filter. Tot 20Hz wordt weggefliterd !!! WAT IS HIER INPUT U? !!! - double yHP = Filter(u, v1_HP_R, v2_HP_R, a1_HP, a2_HP, b0_HP, b1_HP, b2_HP, gain_HP); + // High Pass filter. Tot 20Hz wordt weggefliterd + double yHP = Filter(y50b, v1_HP_R, v2_HP_R, a1_HP, a2_HP, b0_HP, b1_HP, b2_HP, gain_HP); // Absolute waarde wordt genomen. double y1 = fabs(yHP); @@ -85,5 +86,4 @@ double y = 10 * yLP; return y; -} - + } \ No newline at end of file