Changed some stuff
Fork of EMG by
Diff: emg.cpp
- Revision:
- 26:bd50afa17436
- Parent:
- 24:b7b3e87e0687
- Child:
- 27:25d0ee8cd7b7
--- a/emg.cpp Thu Oct 22 14:43:33 2015 +0000 +++ b/emg.cpp Wed Oct 28 13:39:45 2015 +0000 @@ -15,8 +15,6 @@ double p_highV[4]; double p_lowV[4]; -//double lastOutputs[MOV_AVG_NUM-1]; - double filter(double input, double coeff_input[], double coeff_output[], double prev_outputs[]) { double new_input = input; @@ -33,16 +31,19 @@ prev_outputs[0] = new_input; return new_output; } + double fh_b[]= {0.7602, -3.0406, 4.5609, -3.0406, 0.7602}; double fh_a[]= {1, -3.4532, 4.5041, -2.6273, 0.5778}; double b_highpass_filter(double u) { return filter(u, fh_a, fh_b, t_highV); - } +} + double t_highpass_filter(double u) { return filter(u, fh_a, fh_b, b_highV); } + double p_highpass_filter(double u) { return filter(u, fh_a, fh_b, p_highV); @@ -54,20 +55,21 @@ { return filter(u, fl_a, fl_b, t_lowV); } + double t_lowpass_filter(double u) { - return filter(u, fl_a, fl_b, b_lowV); } + double p_lowpass_filter(double u) { - return filter(u, fl_a, fl_b, p_lowV); } double last_biceps = 0; double last_triceps = 0; double last_push = 0; + /** Sample function * this function samples the emg and sends it to HIDScope **/