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];//为什么程序每次执行到这就一直停着? |