void fir_filter(void)
{
int i,j;
float sum;
float x1[932];
float h[31]={ 0.01492972,0.01096342,0.01458647,0.0186,0.02309,0.0278,0.03268,0.037587,
0.0423831,0.04692,0.051058,0.05466,
0.057597,0.059775,0.061111,0.061563,
0.0611111,0.0597754,0.05759762,0.05466,
0.051058,0.0469205,0.04238,0.037587,
0.03268,0.0278036,0.02309,0.0186523,
0.01458,0.0109634,0.014929,};
//x2=1;
for(i=0;i<900;i++)
{
x1[i+31]=Output0[i];//为什么程序每次执行到这就一直停着?
};
for(i=0;i<932;i++)
{
sum=0.0;
for(j=0;j<31;j++)
{
if(i >= j)
sum+=h[j]*x1[i-j];
else
;
}
Output0[i]=(int16)sum>> 15;
}
}
x1[i+31]=Output0[i];//为什么程序每次执行到这就一直停着?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
好像是存储空间不够,这个滤波算法也有点问题
别的代码有多少啊 不至于内存不够吧
不行换个CMD试试
一周热门 更多>