How to use properly the DSP library functions?
I'm working with the matricial operation and I want to use for my first time the dsplib_dsp.h
library. I'm in the Harmony framework. From the XC32 I found the mips_vec_dotp32
where indata1 and indata2 are in Q31 format. I haven't confidence with this format and I don't understand how to use the function. My original basic code for a dot product between vectors is the following
uint32_t i, N = 100;
double vectorA, vectorB;
double mul = 0;
//...Fill the vectors with double values...
for ( i = 0; i < N; i++ )
mul +=vectorA[i] * vectorB[i];
and for the matrix product
uint32_t i, j, k, N = 100;
double matrixA, matrixB, result;
//...Fill the matrix with double values...
for(i=0; i<N; ++i)
for(j=0; j<N; ++j)
for(k=0; k<N; ++k)
Now, how can I the mips_vec_dotp32
function in this code to improve the performance (if there will be an improvement)? Can anyone show me a little example?