📄 iir1.c
字号:
/********************************************************************
* iir1.c - Function for IIR filtering using direct-form I structure
********************************************************************/
float iir1(x,y,b,nb,a,na)
float *x, *y; // x is input vector, y is output vector
float *b, *a; // numerator and denominator coefficients
int nb, na; // length of coefficient vectors
{
float yn = 0.0; // output of IIR filter, y(n)
float yn1 = 0.0; // temporary storage for feedforward section
float yn2 = 0.0; // temporary storage for feedback section
int i,j; // loop index
for (i=0; i<nb; ++i) // feedforward section
{
yn1 += b[i]*x[i];
}
for (j=1; j<ab; ++j) // feedback section
{
yn2 += a[j]*y[j];
}
yn = yn1-yn2; // combine two sections
return(yn); // return y(n) to calling function
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -