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 mbed MODSERIAL QEI
Diff: EMG.cpp
- Revision:
- 15:a24b30061c5f
- Parent:
- 11:dd1976534a03
- Child:
- 16:a2a73d57d556
--- a/EMG.cpp Wed Nov 01 13:08:04 2017 +0000
+++ b/EMG.cpp Wed Nov 01 13:32:43 2017 +0000
@@ -7,31 +7,23 @@
LoPass( 0.003621682, 0.007243363, 0.003621682, 1.000000000, -1.822694925, 0.837181651)
{
cntr = 0;
-
-
-
}
-double EMG::get_notch(double data){ // remove 50Hz peak dew to all electrical network apliances
+
-
+double EMG::get_noise(){ // remove noise from the system (noise is conciderd 80Hz+)
+
+ return Low_pass.step(_data);
+}
+
+double EMG::get_notch(double data){ // remove 50Hz peak dew to all electrical network apliances
return MainsReject.step(data);
}
-
-
-double EMG::get_noise(){ // remove noise from the system (noise is conciderd 80Hz+)
-
-
-
- return Low_pass.step(_data);
-}
-
+
double EMG::get_DC(double data){ // remove DC offset from the signal (High pass filter above 10Hz)
-
-
return HiPass.step(data);
}
@@ -39,16 +31,13 @@
double EMG::get_absolute(double data){ //get the absolute value of the signal
- return abs(data);
-
+ return fabs(data);
}
double EMG::get_envelope(double data){ // return the envelope of the signal (low pass filter at 5Hz)
-
-
return LoPass.step(data);
}
@@ -64,4 +53,9 @@
return get_envelope(get_absolute(get_DC(get_notch(get_noise()))));
}
+}
+
+double EMG::get_data(){
+
+ return _data;
}
\ No newline at end of file
