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.

Problem with DSP_fir_cplx() from DSPLIB 3.2.0.1

Other Parts Discussed in Thread: TMS320C6657

Hi,

I'm struggling to get the DSP_fir_cplx() function to produce any reasonable output. I'm currently testing it with a real, symmetric filter and with a very basic input signal:

short h[32] =
{
  -57, 0,  -32, 0,  289, 0,  251, 0,
 -827, 0, -969, 0, 2488, 0, 7049, 0,
 7049, 0, 2488, 0, -969, 0, -827, 0,
  251, 0,  289, 0,  -32, 0,  -57, 0,
};

 

short x[48] =
{
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
  1, 1,
};

short result[16] = {0};

 

Here's the way I used to call the function (`old way', DSPLIB 3.1.0.0):

DSP_fir_cplx(&x[30], &h[0], &result[0], 16, 8);

 

And here's the output that I get:

result =
{
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
};

 

This is not symmetric so clearly it's wrong. I noticed that in the latest header file (DSP_fir_cplx.h) the API has changed and that now I should be calling DSP_fir_cplx() like this:

DSP_fir_cplx(&x[30], &h[32], &result[16], 16, 8);

 

In this case, however, I get the following:

 

result =
{
  0, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
  1, 0,
};

 which is also non-symmetric, hence wrong. Moreover, according to the reference C files (DSP_fir_cplx.c and DSP_fir_cplx_cn.c) the API hasn't changed! This is all getting a bit confusing.

Does anyone anyone know the right way of calling DSP_fir_cplx() for my simplified input data? Otherwise I'm not able to use in more realistic settings.

I am testing it with a TMS320C6657 board, but this seems only mildly relevant. I also made sure that all the input is properly aligned.

Thanks!

 

  • Hi Andrze

    Here is my suggestion -

    Look at the function DSP_fir_cplx_cn in the file DSP_fir_cplx_cn.c in the src directory

    This is a natural C (not optimized) version of the complex fir filter.

    Run it with your example and see if you get the same results as teh optimized version

    If the answer is yes, look at the code and see what teh parameters should be

    If teh answer is no, we may have a problem

     

    Regards   Ran

     

  • Hi Ran,

    I compared the optimised and the natural C versions of DSP_fir_cplx() Unfortunately, they give different answers. The optimised C version gives me what I would expect.

    Best,

    Andrzej