AnsweredAssumed Answered

Optimized Complex SUM/SUB

Question asked by DspWork on Apr 13, 2016
Latest reply on Apr 28, 2016 by Kader.M

Could someone please provide an equivalent optimized code for summing an array of complex?

 

complex_fract32  csum;

complex_fract16  data[288];

int  ii = 0;

int  jj = 0;

int  idx = 0;

 

for( jj=0; jj < 288; jj++ )

{

   for( ii=0; ii < 64; ii++ )

   {

      csum.re += data[idx].re;

      csum.im += data[idx].im;

      if( idx == 288 ) { idx = 0; }

   }

}

 

Is there an intrinsic add complex function with complex_fract16 input and complex_fract32 output?

How do I use the accumulator type acc40 to handle the complex sum?

What is the most optimized way to do the above loops?

Outcomes