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.

dsp_fir_gen

Hi.

I am using the function dsp_fir_gen ,

The input is a gray level matrice ( 0 to 255 gray level) , The  coefficient array is  0,-40,-55,-44,-25,-10    .

The output is zero ,

The C implementation of the function is using the line  r[j] = sum >> 15;

It looks like this line makes the output array zero .

Please Advise.

Ephraim Oved.

  • Ephraim,

    This algorithm is expecting shorts for the Input, Coefficient, and Output arrays.  Shorts on the c6x are 16-bits.  I suspect that you are using 8-bit types since you only have 255 gray scale levels.  The shift of the sum takes the most significant bits in the 32-bit intermediate result and stores the lower 16 bits in r[j]. 

    You can either change your  input types to be 16-bit, which will waste some memory because your arrays will now be double the size, or you can modify the code t(or write your own) to handle 8-bit values.

    Regards,
    Dan