AnsweredAssumed Answered

How can I create an optimal frame delay?

Question asked by chuiberto on Jul 11, 2013
Latest reply on Jul 22, 2013 by chuiberto

I'm working with a SHARC 21368 and I have the following code to delay a frame "in"  for SIZE_DELAY samples, but I know that itsn't an efficient way to do this, could anyone help me with an optimization for this code?

 

 



 

for (i=0; i<SIZE_FRAME; i++){





last=buffer[ptr_buffer];


buffer[ptr_buffer]=in[i];


ptr_buffer=(ptr_buffer+1)%SIZE_DELAY;


in[i]=tempf;

}


 

NOTATION

in: is my input frame block with size SIZE_FRAME

last= it's a memory for the oldest sample;

buffer = is an array used like circular buffer

ptr_buffer = it's works like a pointer in the buffer

 

Thanks a lot,

Outcomes