[an error occurred while processing this directive]
|
/* 3rd Order Low Pass Butterworth */
/* Bilinear Transformation with Prewarping */
/* Sample Frequency = 10.00 Hz */
/* Standard Form */
/* Arithmetic Precision = 4 Digits */
/* */
/* Pass Band Frequency = 1.000 Rad/Sec */
/* */
/******************************************************************************/
/* */
/* 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 sumnum, sumden; int i;
static float delay[4] = {0.0,0.0,0.0,0.0};
static float znum[4] = {
1.134e-04,
3.401e-04,
3.401e-04,
1.134e-04
};
static float zden[3] = {
-.8187,
2.62,
-2.8
};
if (setic==1){
for (i=0;i<=3;i++) delay[i] = 1102.0*initval;
return initval;
}
else{
sumden=0.0;
sumnum=0.0;
for (i=0;i<=2;i++){
delay[i] = delay[i+1];
sumden += delay[i]*zden[i];
sumnum += delay[i]*znum[i];
}
delay[3] = invar-sumden;
sumnum += delay[3]*znum[3];
return sumnum;
}
}
E-mail: info@telesys.ru