This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

28335的FIR滤波

FIR滤波的起始从零开始上升那段有没有办法避免掉?


程序如下:void fir_filter(float b[],float c[])

{

    int i,j=0;

    float sum;

    float h[21]={

              -0.09055792262407, 0.009744804975761,  0.01838867509003,  0.03195961694651,

               0.04917012260358,  0.06836127325356,  0.08774901331544,   0.1053433191277,

                0.1194310387162,    0.128484986607,   0.1316381457976,    0.128484986607,

                0.1194310387162,   0.1053433191277,  0.08774901331544,  0.06836127325356,

               0.04917012260358,  0.03195961694651,  0.01838867509003, 0.009744804975761,

              -0.09055792262407

               };

 

    for(i=0;i<300;i++)

    {

       sum=0.0;

       for(j=0;j<21;j++)

       {

           if(i >= j)

           sum+=h[j]*b[i-j];

           else

           ;

 

       }

       c[i]=sum;

    }