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 library functions

Hi ,

I am using dsp library functions , when I try to use the functions with _opt , they show me undefined error .I am using CCS 5.3 and dsp lib dsplib_c674x_3_2_0_1.

I have added the dsp lib and the header file. The non _opt functions are working fine. Please let me know if I am missing something.

  • Please confirm the DSP part used. Thank you.
  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    Moving this thread to correct forum for faster response. Thank you for your patience.

  • Hi,

    Thanks for your post.

    To my opinion, there is no C674x DSP library kernel function API's supplied with _opt and I remember, there are API's like "DSPF_sp_fir_cplx_opt " kernel function which is part of dsplib_c66x_3_0_0_8. Please check for the available kernel functions from C674x DSPLIB wiki as shown below:

    http://processors.wiki.ti.com/index.php/C674x_DSPLIB#Single-Precision_Kernels

    Please check the above wiki for the available kernel library API's for C674x and I am sure, there are no API functions with _opt. You could also check the /docs folder on the DSPLIB installation folder as below:

    ~\ti\dsplib_c674x_3_2_0_1\docs\doxygen\html\dsplib_html\modules.html

    May be, You could try the work around by changing the DSPF_sp_fir_cplx.h file to have the _opt in the function definition to fix your undefined error and the implementation file you should refer "DSPF_sp_firl_cplx". There are also known bugs on the kernel functions with _opt  on dsplib_c66x_3_0_0_8 and kindly check the release notes of the same to check for any known issues.

    Thanks & regards,

    Sivaraj K

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

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

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

  • Hi ,

    Thanks all for you reply , I guess I did not explain my issue clearly .I installed dsplib_c674x_3_2_0_1_Win32.exe and after installation ,

    I am trying to use  DSPF_sp_mat_mul_cplx() . The document says there is DSPF_sp_mat_mul_cplx_opt function that can also be used. Similarly

    DSPF_sp_fir_cplx   is available , the same document on the same page states DSPF_sp_fir_cplx_opt is the optimized version  of the code and I am trying to use this function.  If this function does not exists or compiled in the dsp.lib why provide it in the document.

    I tried to copy the page below , please have a look at it.

    DSPF_sp_fir_cplx
    [Filtering and convolution]

    Collaboration diagram for DSPF_sp_fir_cplx:


    Detailed Description

    void  DSPF_sp_fir_cplx (const float *x, const float *h, float *restrict y, int nh, int nr)
    void  DSPF_sp_fir_cplx_opt (const float *x, const float *h, float *restrict y, int nh, int ny)

    Function Documentation

    void DSPF_sp_fir_cplx ( const float *  x,
    const float *  h,
    float *restrict  y,
    int  nh,
    int  nr  
    )

    This function implements the FIR filter for complex input data. The filter has nr output samples and nh coefficients. Each array consists of an even and odd term with even terms representing the real part and the odd terms the imaginary part of the element. The coefficients are expected in normal order.

    Parameters:
    x[2*(nr+nh-1)]  Pointer to complex input array. The input data pointer x must point to the (nh)th complex element.
    h[2*nh]  Pointer to complex coefficient array.
    r[2*nr]  Pointer to complex output array.
    nh  Number of complex coefficients in vector h.
    nr  Number of complex output samples to calculate.
    Algorithm:
    DSPF_sp_fir_cplx_cn.c is the natural C equivalent of the optimized linear assembly code without restrictions. Note that the linear assembly code is optimized and restrictions may apply.
    Assumptions:
    nr is a multiple of 2 and greater than or equal to 2.
    nh is a multiple of 2 and greater than or equal to 5.
    x, h and r are double-word aligned.
    x points to 2*(nh-1)th input element.
    Implementation Notes:
    Interruptibility: The code is interruptible.
    Endian Support: The code supports both big and little endian modes.

    void DSPF_sp_fir_cplx_opt ( const float *  x,
    const float *  h,
    float *restrict  y,
    int  nh,
    int  ny  
    )
  • Hi,

    Thanks for your clarification. Now it sounds good.

    When you use DSP library kernel functions with optimized version, what is the undefined error you are getting?

    Please shed some light on the error details.

    Thanks & regards,
    Sivaraj K
  • Dhruva,

    Please download the latest version of DSPLIB for C674x, dsplib_c674x_3_4_0_0. I believe this problem has been fixed.

    I do not have 3.2 installed, but with 3.1 I could see that the _opt version was not declared in the DSPF_sp_fir_cplx.h file, but in the latest 3.4 version this declaration has been added.

    You should also be able to get your existing version to work by just adding the declaration in your own source file before accessing the function:

    void DSPF_sp_fir_cplx_opt(const float * x, const float * h,
    float * restrict y, int nh, int ny);

    Please let us know if this helps.

    Regards,
    RandyP
  • Thanks for the response. I did install the latest version of dsp lib as u mentioned. This is the error I received.

    undefined first referenced

    symbol in file

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

    _DSPF_sp_fir_cplx_opt ./src/main.obj

    error #10234-D: unresolved symbols remain

  • Dhruva,

    Good. Now we know what your error message is. Is this different than when you started?

    When you do the build, the last step is the linker and that is when this error message appears. There will be a spew in the console window that has the linker command followed by all the arguments supplied to the linker, and then the error messages. Please copy and paste from the linker command to the end of that spew for the linker, including the error messages, and reply with that information to this thread.

    Regards,
    RandyP
  • Dhruva,

    What I am starting to think is that the documentation showing the _opt version of the function is simply leading us all astray.

    It looks to me that the optimized assembly code in the .s source file is what is included in the library. I am thinking that the _opt source file is offered as a helpful example for you and me to use for learning purposes or to use by including that source in our local projects when we want to customize it in some way.

    Hopefully, we will get a comment from someone who knows the truth, but in my opinion you are getting the correct and most optimized version of the routine when you call the function name without _opt and everything works.

    The documentation could be more clear, assuming I am correct in my understanding.

    Regards,
    RandyP
  • Dhruva and all users,

    I did hear back confirmation from our factory applications team on this:

    "The ... library links the best code for the performance which is from the linear assembly version DSPF_sp_fir_cplx.s file. The DSPF_sp_fir_cplx_674_LE_ELF project with the test bench provided in the dsp library folder, explicitly includes the DSPF_sp_fir_cplx_opt.c file so that the test bench can run and all the three benchmark results can be published ( C, intrinsics C and assembly)."

    In my opinion, the _opt prototype should not be listed in the API Reference section of the DSPLIB User Guide, to avoid the confusion you and I went through on this. Instead, there should be mention of the fact that there are multiple source files available for use as examples of the function's operation (_cn), of optimized linear assembly (.s), and of optimized C (_opt).

    Best regards,
    RandyP