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.
Dependents: PID_VelocityExample TheProgram Passief_stuurprogramma Actief_stuurprogramma
Diff: EMG.h
- Revision:
- 7:8ce86cc65126
- Parent:
- 6:49056e5ea42e
- Child:
- 8:8473897a212d
- Child:
- 9:7da462802e5f
--- a/EMG.h Wed Oct 14 13:16:07 2015 +0000 +++ b/EMG.h Thu Oct 15 12:05:39 2015 +0000 @@ -46,13 +46,6 @@ y1 = highpass1.step(u1); y2 = highpass2.step(u2); y3 = highpass3.step(u3); y4 = highpass4.step(u4); // filter order is: high-pass --> rectify --> low-pass y1 = fabs(y1); y2 = fabs(y2); y3 = fabs(y3); y4 = fabs(y4); y1 = lowpass1.step(y1)*cali_fact1; y2 = lowpass2.step(y2)*cali_fact2; y3 = lowpass3.step(y3)*cali_fact1; y4 = lowpass4.step(y4)*cali_fact1; // roughly normalize to a scale of 0 - 1, where 0 is minimum and 1 is roughly the maximum output of dennis. - - - - - - - } @@ -78,6 +71,12 @@ { cali_max1 = y1; } + wait(1/(float)Fs); + } + wait(1); // seperated calibration of muscles, including a wait period of a second between the calibration of each thing. + for(int i = 0; i < 5*Fs; i++) + { + sample_filter(); if(y2 > cali_max2) { cali_max2 = y2;