这几个都是啥滤波器的程序哇?
下面几个都叫啥滤波器哇?1、
//! \brief Runs a second-order filter of the form
//! y[n] = b0*x[n] + b1*x[n-1] + b2*x[n-2] - a1*y[n-1] - a2*y[n-2]
static _iq FILTER_SO_run(FILTER_SO_Handle handle,const _iq inputValue)
{
FILTER_SO_Obj *obj = (FILTER_SO_Obj *)handle;
_iq a1 = obj->a1;
_iq a2 = obj->a2;
_iq b0 = obj->b0;
_iq b1 = obj->b1;
_iq b2 = obj->b2;
_iq x1 = obj->x1;
_iq x2 = obj->x2;
_iq y1 = obj->y1;
_iq y2 = obj->y2;
// compute the output
_iq y0 = _IQmpy(b0,inputValue) + _IQmpy(b1,x1) + _IQmpy(b2,x2)
- _IQmpy(a1,y1) - _IQmpy(a2,y2);
// store values for next time
obj->x1 = inputValue;
obj->x2 = x1;
obj->y1 = y0;
obj->y2 = y1;
return(y0);
}
2、
//! \brief Runs a simplified second-order filter of the form
//! y[n] = b0*x[n] - a1*y[n-1] - a2*y[n-2]
static _iq FILTER_SO_run_form_0(FILTER_SO_Handle handle,const _iq inputValue)
{
FILTER_SO_Obj *obj = (FILTER_SO_Obj *)handle;
_iq a1 = obj->a1;
_iq a2 = obj->a2;
_iq b0 = obj->b0;
_iq y1 = obj->y1;
_iq y2 = obj->y2;
// compute the output
_iq y0 = _IQmpy(b0,inputValue) - _IQmpy(a1,y1) - _IQmpy(a2,y2);
// store values for next time
obj->y1 = y0;
obj->y2 = y1;
return(y0);
}
3、
//! \brief Runs a second-order filter of the form
//! y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1] - a2*y[n-2]
static _iq FILTER_SO_run_form_1(FILTER_SO_Handle handle,const _iq inputValue)
{
FILTER_SO_Obj *obj = (FILTER_SO_Obj *)handle;
_iq a1 = obj->a1;
_iq a2 = obj->a2;
_iq b0 = obj->b0;
_iq b1 = obj->b1;
_iq x1 = obj->x1;
_iq y1 = obj->y1;
_iq y2 = obj->y2;
// compute the output
_iq y0 = _IQmpy(b0,inputValue) + _IQmpy(b1,x1)
- _IQmpy(a1,y1) - _IQmpy(a2,y2);
// store values for next time
obj->x1 = inputValue;
obj->y1 = y0;
obj->y2 = y1;
return(y0);
}