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: AsyncSerial Lib_DFPlayerMini Lib_MPU9250_SPI mbed
filter_func.h
- Committer:
- bluefish
- Date:
- 2018-05-02
- Revision:
- 7:77174a098e6f
- Parent:
- 6:a5f674c2f262
File content as of revision 7:77174a098e6f:
#ifndef __FILTER_FUNCTIONS_H__ #define __FILTER_FUNCTIONS_H__ #include <math.h> #include "mbed.h" typedef enum _BIQUADTYPE{ FILTER_LPF = 1, FILTER_HPF = 2, FILTER_BPF = 3, FILTER_NF = 4 } BIQUADTYPE; typedef struct _STCOMPFILTER{ float _int; float _adj; float _adj_temp; float _param; } STCOMPFILTER; typedef struct _STBIQUADFILTER{ float in[2]; // input float out[2]; // output float a[3]; // coefficient A float b[3]; // coefficient B } STBIQUADFILTER; // complimentary filter void init_comp_filter( STCOMPFILTER* filter, float param ); void proc_comp_filter( STCOMPFILTER* filter, float dt, float angle_raw, float angle_vec_raw, float* angle, float* angle_vec ); // BiQuad filter void init_biquad_filter( STBIQUADFILTER* filter, float freq_sample, float freq, float param, BIQUADTYPE filter_pattern ); float proc_biquad_filter( STBIQUADFILTER* filter, float input ); #endif