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 MODSERIAL mbed-dsp mbed
Fork of emg_filter by
Revision 20:f7d281e3112b, committed 2014-09-29
- Comitter:
- vsluiter
- Date:
- Mon Sep 29 13:08:57 2014 +0000
- Parent:
- 19:dbc1bca498e3
- Child:
- 21:133e9390a42a
- Commit message:
- Corrected array assignment for states
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Sep 29 12:01:13 2014 +0000
+++ b/main.cpp Mon Sep 29 13:08:57 2014 +0000
@@ -13,10 +13,13 @@
arm_biquad_casd_df1_inst_f32 lowpass;
//constants for 5Hz lowpass
float lowpass_const[] = {0.02008337 , 0.04016673 , 0.02008337 , 1.56101808 , -0.64135154};
-
+//state values
+float lowpass_states[4];
arm_biquad_casd_df1_inst_f32 highpass;
//constants for 0.5Hz highpass
float highpass_const[] = {0.97803048, -1.95606096, 0.97803048, 1.95557824 , -0.95654368};
+//state values
+float highpass_states[4];
/** Looper function
@@ -58,8 +61,8 @@
{
//set up filters. Use external array for constants
- arm_biquad_cascade_df1_init_f32(&lowpass,1 , lowpass_const, lowpass.pState);
- arm_biquad_cascade_df1_init_f32(&highpass,1 ,highpass_const,highpass.pState);
+ arm_biquad_cascade_df1_init_f32(&lowpass,1 , lowpass_const, lowpass_states);
+ arm_biquad_cascade_df1_init_f32(&highpass,1 ,highpass_const,highpass_states);
/**Here you attach the 'void looper(void)' function to the Ticker object
* The looper() function will be called every 0.01 seconds.
