求帮助编写一个六阶巴特沃斯低通滤波器,截止频率为35HZ,采样频率为100HZ,求matlab的此程序啊,
/* 6th Order Low Pass Butterworth */
/* Bilinear Transformation with Prewarping */
/* Sample Frequency = 100.0 Hz */
/* Standard Form */
/* Arithmetic Precision = 4 Digits */
/* */
/* Pass Band Frequency = 35.00 Hz */
/* */
/******************************************************************************/
/* */
/* Input Variable Definitions: */
/* Inputs: */
/* invar float The input to the filter */
/* initvar float The initial value of the filter */
/* setic int 1 to initialize the filter to the value of initvar */
/* */
/* There is no requirement to ever initialize the filter. */
/* The default initialization is zero when the filter is first called */
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的没有,不过你可以将其C语言转换成Matlab的仿真一下!