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-dsp mbed
Fork of Project5-filteringBiceps by
Diff: main.cpp
- Revision:
- 29:40a157c53841
- Parent:
- 28:c40dc343033f
- Child:
- 30:2162f7a82fc7
diff -r c40dc343033f -r 40a157c53841 main.cpp
--- a/main.cpp Thu Oct 16 19:30:22 2014 +0000
+++ b/main.cpp Fri Oct 17 18:18:23 2014 +0000
@@ -52,7 +52,31 @@
arm_biquad_cascade_df1_f32(¬ch, &emg_value_f32, &filtered_emg_notch, 1 );
arm_biquad_cascade_df1_f32(&highpass, &filtered_emg_notch, &filtered_emg_notch_highpass, 1 );
arm_biquad_cascade_df1_f32(&lowpass, &filtered_emg_notch_highpass, &filtered_emg_notch_highpass_lowpass, 1 );
- filtered_emg_eindsignaal_abs = 10*fabs(filtered_emg_notch_highpass_lowpass);
+ filtered_emg_eindsignaal_abs = 10*fabs(filtered_emg_notch_highpass_lowpass); //gelijkrichter
+
+ //Movag berekenen
+
+ float mean(float *60, int n) {
+ float sum = 0.0;
+ for (int i=0; i<n; i++) {
+ sum += samples[i];
+ }
+ return sum / (float)n;
+}
+
+ //of
+ typdef struct
+{
+ int32_t prev;
+ uint16_t gain;
+}IIR_Filter_Data;
+
+int16_t IIR_Filter(int16_t input, IIR_Filter_Data* Fdata)
+{
+ Fdata->prev += input * Fdata->gain;
+
+ return (Fdata->prev >> 16);
+}
scope.set(0,emg_value_f32);
scope.set(1,filtered_emg_notch);
