| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1361 人关注过本帖
标题:这几个都是啥滤波器的程序哇?
只看楼主 加入收藏
喜鹊王子
Rank: 1
等 级:新手上路
帖 子:105
专家分:0
注 册:2012-12-25
结帖率:89.74%
收藏
 问题点数:0 回复次数:0 
这几个都是啥滤波器的程序哇?
下面几个都叫啥滤波器哇?
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);
}
搜索更多相关主题的帖子: filter 滤波器 
2016-08-15 20:39
快速回复:这几个都是啥滤波器的程序哇?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015728 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved