#ifndef filter_h
#define filter_h

#include "ArduWin.h"

#define _USE_MATH_DEFINES
#include "gimbalDef.h"
//#include <math>
//#include <string.h>

//	------------------
//  filter types
//	------------------
#if 0
enum {
    FILTER_NONE,
    FILTER_LAGLEAD,
    FILTER_NOTCH,
    FILTER_LOWPASS,
};
#endif

//  ------------------
//  hsFilterState
//  ------------------

typedef struct {
	double x0Gain;
	double x1Gain;
	double x2Gain;
	double y1Gain;
	double y2Gain;
	double x1;
	double x2;
	double y1;
	double y2;
} filterState_t;

class filter
{
public:
	filter(void);
	~filter(void);
	void initFilters(int axis);
    float runfilters(float in, int axis);
    float runfilter(float in, int axis, int ifilter);
	void getFilter(int axis,int ifilt,filterPar_t *fp);
	void setFilter(int axis,int ifilt,filterPar_t *fp);
    void addFilter(int axis,int ifilt,int ftype, float f1, float q);

//  ------------------
//  hsFilters
//  ------------------

    filterPar_t filtP[NiAXES][NiFILT];
    filterState_t filtState[NiAXES][NiFILT];
};

#endif
