⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fre_filter_even.cpp

📁 c语言版各种fir滤波器的实现
💻 CPP
字号:
/**********************************************
* Filename : Fre_filter_even.CPP              *
* Function : realization of FIR filter with   *
             Frequency sample structure while *
			 n is even                        *
*Parameter : (c) the Amplitude of frequncy    *
                 sample point H(k)            *
             (b) the coeffocients of          *
			     numerator of every part of   *
				 H(z)                         *
             (a) the coefficients of          *
                 denominator of every part    *
				 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 fre_filter_even(float c[],float b[],float a[],float z[],float x[],float y[],int n,int m)
{
	int i,j;
	float tm_y;
	for(i=0;i<m;i++)
	{
		y[i]=x[i]-z[0];
		for(j=0;j<n-1;j++)
		{
			z[j]=z[j+1];
		}
		z[n-1]=x[i];
		x[i]=y[i];
		y[i]=0.0;
		for(j=0;j<(n+2)/2;j++)
		{
			tm_y=b[j*2]*x[i]+z[n+j*2];
			z[n+j*2]=b[j*2+1]*x[i]+z[n+j*2+1]-a[j*2]*tm_y;
			z[n+j*2+1]=-a[j*2+1]*tm_y;
			tm_y=c[j]*tm_y;
			y[i]=y[i]+tm_y;
		}
		y[i]=y[i]/n;

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -