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.

Calling fir2 functiom

Hi.

I have a problem using the fir2() function, the   

ushort fir2 (DATA *x, DATA *h, DATA *r, DATA *dbuffer,
ushort nx, ushort nh)

my declaration are

Int16 Indata[1];    to be used by Data*x pointer

Int16 Coefficient[241]; an array  for the coefficients

Int16 output[1]; array for the output

When i  call the filter function i use this Calling syntax

fir2(Indata,Coefficient,output,244,1,242);

But i dont get any output values for the signal  from output array .....................What can be wrong? i

  • This doesn't look right - read through the fir2 section of the TMS320C55x DSP Library Programmers Reference

    http://www.ti.com/lit/ug/spru422j/spru422j.pdf

    And look at the fir2 examples at <DSPLIB install path>\dsplib_2.40.00\EXAMPLES\fir2\

    Why is your input and output arrays of length 1? The examples shows smallest length of 8.

    Also, I have a hunch that NH - length of coefficients should be even only - not sure but all examples have even NH.

    Maybe NX - length of input and output arrays also must be even - examples all even, and between 8 and 256. Could check the assembly.

    Have you also managed memory alignment?

    In the examples...

    The .cmd file aligns .dbuffer to the top of DARAM3: 

    .dbuffer : {} > DARAM3 PAGE 0

    Then in t8.h you see pragmas that assign arrays to those memory locations:

    #pragma DATA_SECTION(h,".coeffs")

    #pragma DATA_SECTION(db,".dbuffer")

    Perhaps you can start by creating a project with the example files and getting that to work, then extending it to your application.

    Examples available on SPRC100

    Hope this helps,
    Mark