C语言版,信号数字滤波程序有问题求指导?
程序代码:
程序跑不通,问题是: Error:argument of type “float”is incompatible with parameter of type “float” *低通滤波处理信号*/ /*20点滤波器系数*/ float h[27]= { -0.000717157271056, -0.002859115151905, -0.007322125396880, -0.014242951623687, -0.022224922136667, -0.027860512534959, -0.026133393824031, -0.011903955491711, 0.017861106212959, 0.061991725990918, 0.114215389756709, 0.164174174504389, 0.200282581002263, 0.213462981531864, 0.200282581002263, 0.164174174504389, 0.114215389756709, 0.061991725990918, 0.017861106212959, -0.011903955491711, -0.026133393824031, -0.027860512534959, -0.022224922136667, -0.014242951623687, -0.007322125396880, -0.002859115151905, -0.000717157271056}; void filter(float h[ ],int xin[],int xout[]) { unsigned int i,j,n; n=27; int length = 200;/* 信号为200点=2s*50Hz采样*/ static int x1[226]; //200+27-1 static int x1[length+20]; int sum; for(i=0;i<length;i++) x1[n+i-1]=xin[i]; for (i=0;i<length;i++) { sum=0; for(j=0;j<n;j++) sum+=h[j]*x1[i-j+n-1]; xout[i]=sum; } for(i=0;i<(n-1);i++) x1[n-i-2]=xin[length-1-i]; }