#ifndef _MY_FILTER
#define _MY_FILTER



#ifdef __cplusplus
  extern "C" {  
#endif




#include "IQmathLib.h"
//#include "filter.h"
//#include "myfir16.h"



#define k1_filter_1p_fast   62643  // 0.238965*262144
#define k2_filter_1p_fast   136857  // 0.52207*262144
#define k3_filter_1p_fast2   8552


#define filter_1p_fast(predx, predy,inpx)  predy=_IQ18mpy(k1_filter_1p_fast,(predx+inpx))+_IQ18mpy(k2_filter_1p_fast,predy);predx=inpx
#define filter_1p_fast2(predx, predy,inpx)  predy=_IQ18mpy(k3_filter_1p_fast2,(predx+inpx));predx=inpx





//extern FIR16  fir;
//extern FIR16  fir_wrotor;
//extern IIR5BIQ16  iir;


void init_my_filter_fir();
int calc_my_filter_fir(int xn);

void init_my_filter_fir_58();
int calc_my_filter_fir_58(int xn);



void calc_my_filter_fir_50_75hz(_iq xn_0,_iq xn_1,_iq xn_2,_iq xn_3,_iq xn_4,_iq xn_5,
                               _iq *yn_0,_iq *yn_1,_iq *yn_2,_iq *yn_3,_iq *yn_4,_iq *yn_5);

void init_my_filter_fir_50_75hz();



void init_my_filter_iir();
int calc_my_filter_iir(int xn);



_iq19 exp_regul_iq19(_iq19 k_exp_regul, _iq19 InpVarCurr, _iq19 InpVarInstant);
_iq exp_regul_iq(_iq k_exp_regul, _iq InpVarCurr, _iq InpVarInstant);




_iq18 filter_1p(_iq18 predx,_iq18 predy, _iq18 inpx);

void exp_regul_iq_fast(_iq k_exp_regul, _iq *InpVarCurr, _iq InpVarInstant);


_iq zad_intensiv_q(_iq StepP, _iq StepN, _iq InpVarCurr, _iq InpVarInstant);



#ifdef __cplusplus
  }
#endif

#endif /* _MY_FILTER */

