50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
#ifndef _FILTER_BAT2
|
|
#define _FILTER_BAT2
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define K1_FILTER_BATTER2_1HZ 0.0000096
|
|
#define K2_FILTER_BATTER2_1HZ 1.94468056
|
|
#define K3_FILTER_BATTER2_1HZ -0.94471895
|
|
|
|
#define K1_FILTER_BATTER2_3HZ 0.00008766
|
|
#define K2_FILTER_BATTER2_3HZ 1.97347532
|
|
#define K3_FILTER_BATTER2_3HZ -0.97382594
|
|
|
|
#define K1_FILTER_BATTER2_5HZ 0.00024135
|
|
#define K2_FILTER_BATTER2_5HZ 1.95581276
|
|
#define K3_FILTER_BATTER2_5HZ -0.95677816
|
|
|
|
#define K1_FILTER_BATTER2_10HZ 0.00094411
|
|
#define K2_FILTER_BATTER2_10HZ 1.91126422
|
|
#define K3_FILTER_BATTER2_10HZ -0.91504065
|
|
|
|
typedef struct { float k_0;
|
|
float k_1;
|
|
float k_2;
|
|
float i_0;
|
|
float i_1;
|
|
float i_2;
|
|
float u_0;
|
|
float u_1;
|
|
float u_2;
|
|
} FILTERBAT;
|
|
|
|
|
|
#define DEF_FILTERBAT { K1_FILTER_BATTER2_5HZ, \
|
|
K2_FILTER_BATTER2_5HZ, \
|
|
K3_FILTER_BATTER2_5HZ, \
|
|
0,0,0,0,0,0}
|
|
|
|
float filterbat(FILTERBAT *b, float InpVarCurr);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* _FILTER_BAT2 */
|
|
|