oldexamplecode
Dependencies: mbed
PSDdetection.h@0:6863633bf8a4, 2017-03-24 (annotated)
- Committer:
- rik
- Date:
- Fri Mar 24 11:22:30 2017 +0000
- Revision:
- 0:6863633bf8a4
oldexamplecode;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rik | 0:6863633bf8a4 | 1 | |
rik | 0:6863633bf8a4 | 2 | #ifndef PSD_DETECTION_H_ |
rik | 0:6863633bf8a4 | 3 | #define PSD_DETECTION_H_ |
rik | 0:6863633bf8a4 | 4 | #pragma once |
rik | 0:6863633bf8a4 | 5 | |
rik | 0:6863633bf8a4 | 6 | class Arm{ |
rik | 0:6863633bf8a4 | 7 | |
rik | 0:6863633bf8a4 | 8 | public: |
rik | 0:6863633bf8a4 | 9 | Arm(); |
rik | 0:6863633bf8a4 | 10 | ~Arm(); |
rik | 0:6863633bf8a4 | 11 | |
rik | 0:6863633bf8a4 | 12 | // Sets a new reference level |
rik | 0:6863633bf8a4 | 13 | void setReference(int reflevel); |
rik | 0:6863633bf8a4 | 14 | // Updates the array with a new sample and checks wheter a muscle is active |
rik | 0:6863633bf8a4 | 15 | bool checksample(int emgsample); |
rik | 0:6863633bf8a4 | 16 | // Filters the signal with a biquad filter |
rik | 0:6863633bf8a4 | 17 | int biquad10 (int emgsample); |
rik | 0:6863633bf8a4 | 18 | |
rik | 0:6863633bf8a4 | 19 | |
rik | 0:6863633bf8a4 | 20 | private: |
rik | 0:6863633bf8a4 | 21 | int EMGreference; |
rik | 0:6863633bf8a4 | 22 | const int EMGtriggerlevel = 20; // above the reference |
rik | 0:6863633bf8a4 | 23 | int prevEMG[4]; |
rik | 0:6863633bf8a4 | 24 | |
rik | 0:6863633bf8a4 | 25 | }; |
rik | 0:6863633bf8a4 | 26 | |
rik | 0:6863633bf8a4 | 27 | |
rik | 0:6863633bf8a4 | 28 | |
rik | 0:6863633bf8a4 | 29 | #endif |