NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
filter.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include "common/axis.h"
#include "common/filter.h"
#include "common/maths.h"
Include dependency graph for filter.c:

Macros

#define M_LN2_FLOAT   0.69314718055994530942f
 
#define M_PI_FLOAT   3.14159265358979323846f
 
#define BIQUAD_BANDWIDTH   1.9f /* bandwidth in octaves */
 

Functions

float filterApplyPt1 (float input, filterStatePt1_t *filter, uint8_t f_cut, float dT)
 
void BiQuadNewLpf (float filterCutFreq, biquad_t *newState, uint32_t refreshRate)
 
float applyBiQuadFilter (float sample, biquad_t *state)
 
int32_t filterApplyAverage (int32_t input, uint8_t count, int32_t averageState[])
 
float filterApplyAveragef (float input, uint8_t count, float averageState[])
 

Macro Definition Documentation

#define BIQUAD_BANDWIDTH   1.9f /* bandwidth in octaves */
#define M_LN2_FLOAT   0.69314718055994530942f
#define M_PI_FLOAT   3.14159265358979323846f

Function Documentation

float applyBiQuadFilter ( float  sample,
biquad_t state 
)
void BiQuadNewLpf ( float  filterCutFreq,
biquad_t newState,
uint32_t  refreshRate 
)
int32_t filterApplyAverage ( int32_t  input,
uint8_t  count,
int32_t  averageState[] 
)
float filterApplyAveragef ( float  input,
uint8_t  count,
float  averageState[] 
)
float filterApplyPt1 ( float  input,
filterStatePt1_t filter,
uint8_t  f_cut,
float  dT 
)