📄 lp_filter_odd.cpp
字号:
/**********************************************
* Filename : LP_filter_odd.CPP *
* Function : realization of LP FIR filter with*
direct structure,n is odd *
*Parameter : (h) the coefficients of H(z) *
(z) the inner state variables *
(x) the input data *
(y) the output data *
(n) the number of h[] *
(m) the number of input data *
**********************************************/
void LP_filter_odd(float h[],float z[],float x[],float y[],int n,int m)
{
int i,j;
for(i=0;i<m;i++)
{
y[i]=(x[i]+z[n-2])*h[0]+z[(n-3)/2]*h[(n-1)/2];
for(j=0;j<((n-3)/2);j++)
{
y[i]=y[i]+(z[j]+z[n-3-j])*h[j+1];
}
for(j=(n-2);j>0;j--)
{
z[j]=z[j-1];
}
z[0]=x[i];
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -