AnsweredAssumed Answered

DSP21375 FIR output a wrong results ,some elements are incorrect

Question asked by Sunnyhgh on Oct 21, 2015
Latest reply on Nov 23, 2015 by Mitesh

hello all :

            My test is use dsp21375 to  generate a 1khz signal at Sample rate 96khz (A array named "input"  ,which have 192 elements);

    When i use  FIR (use visual dsp ++5.5 lib ) function to test the input ,and it output a wrong results .

The fir have 80 taps,pass band 10khz and stop band 15khz  ,signal degradation :80db.

Test  input line plot:

Array input LinePlot 192 elements.bmp

FIR test output line plot:

   The No.0 to 39 elements incorrect,and the No.152 to 191 elements are missing!

Array output LinePlot.bmp

 

The FIR fuction returns a "state" array,what can i do somthing to avoid error  whith it?

 

 

Software :

#define TAPS 80

#define fs 96000

#define pi 3.14159

float  input[fir_SAMPLES];// FIR INPUT

float  output[fir_SAMPLES];//OUTPUT

float dm state[TAPS+1];

const pm float  coeffs[TAPS]=

                {

                  -0.00142993104524,-0.003289811986829,-0.005282332460651,  -0.0075069448623,

                  -0.00833784587848,-0.007776107140672,-0.005016122768101,-0.001099967770155,

                  0.003213643962488, 0.006016725367764, 0.006414789515753, 0.003780666676801,

                 -0.0007747690201561,-0.005593084934047,-0.008292796716591,-0.007474471569354,

                 -0.002894142730604,  0.00370558678562, 0.009576439183326,  0.01170483457889,

                  0.008546757383277, 0.000697116076388,-0.008783990634843, -0.01564147328494,

                  -0.01604979055559,-0.008671667639916, 0.004414367121836,  0.01793968257963,

                   0.02542079739782,   0.0218443329146, 0.006360386319139, -0.01649993681243,

                  -0.03756126656446, -0.04588317097792, -0.03271438997146, 0.004775757393522,

                   0.06159175162126,   0.1256310834033,    0.181053268937,   0.2131620859593,

                    0.2131620859593,    0.181053268937,   0.1256310834033,  0.06159175162126,

                  0.004775757393522, -0.03271438997146, -0.04588317097792, -0.03756126656446,

                  -0.01649993681243, 0.006360386319139,   0.0218443329146,  0.02542079739782,

                   0.01793968257963, 0.004414367121836,-0.008671667639916, -0.01604979055559,

                  -0.01564147328494,-0.008783990634843, 0.000697116076388, 0.008546757383277,

                   0.01170483457889, 0.009576439183326,  0.00370558678562,-0.002894142730604,

                 -0.007474471569354,-0.008292796716591,-0.005593084934047,-0.0007747690201561,

                  0.003780666676801, 0.006414789515753, 0.006016725367764, 0.003213643962488,

                 -0.001099967770155,-0.005016122768101,-0.007776107140672, -0.00833784587848,

                   -0.0075069448623,-0.005282332460651,-0.003289811986829, -0.00142993104524

                };

                      

    for (i = 0; i < TAPS+1; i++)       state[i] = 0;        

// 1Khz  192 elements

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

    {

       *(input+i) =0.5*sinf(2*pi*1000*(i)/fs);

    }

 

// FIR TEST Process No. 0 to 191 elements

fir (input, output, coeffs, state, fir_SAMPLES, TAPS);

Outcomes