请在Chrome、Firefox等现代浏览器浏览本站。如果需要合作请 点击 加我 QQ 说你的需求。

求帮助编写一个六阶巴特沃斯低通滤波器,截止频

时尚潮流 admin

float DigFil(invar, initval, setic) float invar, initval; int setic; { float sumnum, sumden; int i; static float delay[7] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0}; static float znum[7] = { .1477, .8864, 2.216, 2.955, 2.216, .8864, .1477 }; static fl

  float DigFil(invar, initval, setic)

  float invar, initval; int setic;

  {

  float sumnum, sumden; int i;

  static float delay[7] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0};

  static float znum[7] = {

  .1477,

  .8864,

  2.216,

  2.955,

  2.216,

  .8864,

  .1477

  };

  static float zden[6] = {

  2.183e-02,

  .2099,

  .8779,

  2.055,

  2.91,

  2.38

  };

  if (setic==1){

  for (i=0;i<=6;i++) delay[i] = .1058*initval;

  return initval;

  }

  else{

  sumden=0.0;

  sumnum=0.0;

  for (i=0;i<=5;i++){

  delay[i] = delay[i+1];

  sumden += delay[i]*zden[i];

  sumnum += delay[i]*znum[i];

  }

  delay[6] = invar-sumden;

  sumnum += delay[6]*znum[6];

  return sumnum;

  }

  }

  

  matlab有,2113不过你可以将5261其C4102转换成Matlab的仿真一1653

喜欢 (0) or 分享 (0)