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.
Fork of Filter_check by
Revision 5:41d4aac93351, committed 2017-10-13
- Comitter:
- JornJan
- Date:
- Fri Oct 13 14:24:12 2017 +0000
- Parent:
- 4:8ed071e5e3c9
- Commit message:
- 13okt stuk (tom);
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 13 11:57:15 2017 +0000
+++ b/main.cpp Fri Oct 13 14:24:12 2017 +0000
@@ -13,27 +13,27 @@
int n=0;
//Benoemen van de variabelen die in de VOID's gebruikt gaan worden
-double emga = emg0.read(); //EMG1
+double emga = emg0.read(); //EMG1
double emgb = emg1.read(); //EMG2
// coëfficienten notch filter
-double an[3]={1.0000, -0.0000, 0.9561};
-double bn[3]={0.9780, -0.0000, 0.9780};
+double an[3]={1.0000, -0.0000, 0.9490};
+double bn[3]={0.9745, -0.0000, 0.9745};
// innitial conditions notch filter
double emg_nf[3]={0,0,0};
double emg_in[3]={0, 0, 0};
//Aanmaken filter coëfficienten
-double ah[3]={1.0000, -1.9778, 0.9780};
-double bh[3]={0.9890, -1.9779, 0.9890};
+double ah[3]={1.0000, -1.9933, 0.9934};
+double bh[3]={0.9967, -1.9933, 0.9967};
//innitial conditions high pass filter
double emg_hpf[3]={0, 0, 0};
// coëfficienten low pass filter
-double al[5]={1.0000, -3.5897, 4.8513, -2.9241, 0.6630};
-double bl[5]={0.0000312, 0.0001250, 0.0001874, 0.0001250, 0.0000312};
+double al[5]={1.0000, -3.9179, 5.7571, -3.7603, 0.9212};
+double bl[5]={0.0585e-6, 0.2338e-6, 0.3507e-6, 0.2338e-6, 0.0585e-6};
//innitial conditions low pass filter
double emg_lpf[5]={0, 0, 0, 0, 0};
@@ -49,9 +49,8 @@
{
timer.reset();
- emga = emg0.read();
- emgb = emg1.read();
- emg_in[0]=emga-emgb;
+ emga=emg0.read();
+ emg_in[0]=emga;
//Filter cascade
// notch filter
@@ -100,8 +99,8 @@
motor1MagnitudePin = 0;
motor1DirectionPin = 0;
}
- scope.set(0, emg_in[0]);
- scope.set(1, emg_lpf[0]);
+ scope.set(0, emg_in[1]);
+ scope.set(1, emg_lpf[1]);
scope.send();
if (n==100)
