![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
emg
Dependencies: HIDScope MODSERIAL mbed-dsp mbed TouchButton
Fork of test by
Diff: main.cpp
- Revision:
- 12:d3c69e41b1a8
- Parent:
- 11:5044290660b0
- Child:
- 13:9071a6b3c886
--- a/main.cpp Thu Oct 23 12:13:04 2014 +0000 +++ b/main.cpp Fri Oct 24 07:23:18 2014 +0000 @@ -33,52 +33,15 @@ arm_biquad_casd_df1_inst_f32 lowpassT; arm_biquad_casd_df1_inst_f32 lowpassB; //constants for 50Hz lowpass -float lowpass_const[] = {0.2928920553, 0.5857841107, 0.2928920554, -0, -0.17156822136};//{a0 a1 a2 -b1 -b2} van online calculator +float lowpass_const[] = {0.2928920553, 0.5857841107, 0.2928920554, 0, 0.17156822136};//{a0 a1 a2 -b1 -b2} van online calculator float lowpass_states[4]; arm_biquad_casd_df1_inst_f32 highpassT; arm_biquad_casd_df1_inst_f32 highpassB; //constants for 10Hz highpass -float highpass_const[] = {0.8005910267, -1.6011820533, 0.8005910267, 1.5610153913, -0.6413487154};//{a0 a1 a2 -b1 -b2} +float highpass_const[] = {0.8005910267, -1.6011820533, 0.8005910267, 1.5610153913, 0.6413487154};//{a0 a1 a2 -b1 -b2} float highpass_states[4]; -//*** CALIBRATIE ***//dit moet nog in de main komen! en ik snap dit niet :( -//void Calibratie() -//{ -//pc.printf("Calibratie drempelwaarde Triceps stand 1\n"); -//wait(0.5); -// { -// int i; -// int j=19; - -//for (i=0, i<=j; i++) { -/*variable to store value in*/ -// uint16_t emg_valueT1i_C; - -// float emg_value_f32T1i_C; -/*put raw emg value both in red and in emg_value*/ -// emg_valueT1i_C = emgT1i_C.read_u16(); // read direct ADC result, converted to 16 bit integer (0..2^16 = 0..65536 = 0..3.3V) -// emg_value_f32T1i_C = emgT1i_C.read(); - -//process emg -// arm_biquad_cascade_df1_f32(&highpass, &emg_value_f32T1i_C, &filtered_emgT1i_C, 1 ); -// filtered_emgT1i_C = fabs(filtered_emgT1i_C); -// arm_biquad_cascade_df1_f32(&lowpass, &filtered_emgT1i_C, &filtered_emgT1i_C, 1 ); -// } -// } -//} -//****************************** -//Mean Triceps stand 1 -//void MeanTriceps() -//{ -// -// float MeanT1=filtered_emgT10_C*0.05+filtered_emgT11_C*0.05+filtered_emgT12_C*0.05+filtered_emgT13_C*0.05+filtered_emgT14_C*0.05+filtered_emgT15_C*0.05+filtered_emgT16_C*0.05+filtered_emgT17_C*0.05+filtered_emgT18_C*0.05+filtered_emgT19_C*0.05+filtered_emgT110_C*0.05+filtered_emgT111_C*0.05+filtered_emgT112_C*0.05+filtered_emgT113_C*0.05+filtered_emgT114_C*0.05+filtered_emgT115_C*0.05+filtered_emgT116_C*0.05+filtered_emgT117_C*0.05+filtered_emgT118_C*0.05+filtered_emgT119_C*0.05; -// -//} -//****************************** - - - // *** TRICEPS en BICEPS EMG *** void Triceps()