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.

Scale a vector

Hi,

I want to scale a q15 - vector, so that it will have most precision  (c5515).

So I can use maxind()-function, I can find the numbers to shift and rescale the vector. Is there any efficient lib function or code example for this available?

Thanks and regards

Micky

  • Hello Michael,

    Check out the DSPLIB routines for vectors:

    DSPLIB: http://www.ti.com/tool/sprc100

    short maxidx (DATA *x, ushort ng, ushort ng_size) Index for maximum magnitude in a vector

    short maxidx34 (DATA *x, ushort nx) Index of the maximum element of a vector ≤ 34

    short maxval (DATA *x, ushort nx) Maximum magnitude in a vector

    void maxvec (DATA *x, ushort nx, DATA *r_val,DATA *r_idx) Index and value of the maximum element of a vector

    short minidx (DATA *x, ushort nx) Index for minimum magnitude in a vector

    short minval (DATA *x, ushort nx) Minimum element in a vector

    void minvec (DATA *x, ushort nx, DATA *r_val, DATA *r_idx) Index and value of the minimum element of a vector

    ushort mul32 (LDATA *x, LDATA *y, LDATA *r, ushort nx) 32-bit vector multiply

    ushort add (DATA *x, DATA *y, DATA *r, ushort nx, ushort scale) Optimized vector addition

    short sub (DATA *x, DATA *y, DATA *r, ushort nx, ushort scale) Vector subtraction

    Is this what you are looking for?

    Hope this helps,
    Mark

  • Yes thanks,

    Micky