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.

Linear convolution

Dear Sir/Madam,

I am using I'm using CCS V5.5, C6670 multi core processor to implement linear convolution.

I came across DSPF_sp_convol, in built library. I was wondering if I could get a description on the program, if its linear or circular convolution. I'd like to know mathematics involved in it, if truncation exits then which part of the output is being truncated.

Kindly help me with it.

Thank you.

  • Hi,
    Please refer DSPLIB programmer's reference guide for usage - TMS320C67x DSP Library Programmer’s Reference Guide (SPRU657C). Please get back to us if you need more information on this.

    Thank you.
  • Hi,

    Thanks for your post.

    The above mentioned DSP library routine does the full length convolution of real vectors x(n) and h(n) which is nothing but the linear convolution of x(n) with h(n) in time domain and typically the input data (x) are padded with consecutive zeros at the beginning and end, so obviously the inputs arrays x and h are required to be aligned on a double-word boundary and accordingly the ouput will also be aligned which would automatically pad the zeros.

    Please check the algorithm involved:

    void DSPF_sp_convol(float *x, float *h, float *r, short nh,

    short nr)

    {

    short ocntr, icntr;

    float acc ;

    for (ocntr = nr ; ocntr > 0 ; ocntr−−)

    {

    acc = 0 ;

    for (icntr = nh ; icntr > 0 ; icntr−−)

    {

    acc += x[nr−ocntr+nh−icntr]*h[(icntr−1)];

    }

    r[nr−ocntr] = acc;

    }

    }

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Thank you Rajasekaran and Sivaraj.
    I was going through DSPLIB programmer's reference guide for usage - TMS320C67x DSP Library Programmer’s Reference Guide (SPRU657C). I found out that the written example DSPF_sp_convol is written for convolution is for real inputs of x and h.
    In my case I have input 'x' whose length is 24576 and they all are complex numbers, while input 'h' has a length of 32, they are all real numbers.
    So I moved on to use DSPF_dp_fir_cplx which accepts both inputs as complex unlike my case.

    So I would like to know if there is any other built in program that I can possibly use to implement Linear convolution.
    Thank you.

  • Hi,

    Yes, you are right. We have FIR & IIR filtering kernel functions which do accepts complex values, but if you use convolution routines, it accepts only real input vectors.

    Other than single precsison and double precesion library kernel API's, we do not have any other linear convolution routines and are below;

    DSPF_dp_convol

    DSPF_sp_convol

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------