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

📄 dir_filter.cpp

📁 c语言版各种fir滤波器的实现
💻 CPP
字号:
/**********************************************
* Filename : Dir_filter.CPP                   *
* Function : realization of FIR filter with   *
             direct structure                 *
*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 dir_filter(float h[],float z[],float x[],float y[],int n,int m)
{
	int i,j;
	for(i=0;i<m;i++)
	{
		y[i]=h[0]*x[i]+z[0];
		if(n>1)
		{
			for(j=0;j<n-2;j++)
			{
				z[j]=h[j+1]*x[i]+z[j+1];
			}
			z[n-2]=h[n-1]*x[i];
		}
	}
}

⌨️ 快捷键说明

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