AnsweredAssumed Answered

Circular buffers as input args crosscorrelation

Question asked by Joachim on Mar 4, 2010
Latest reply on Mar 11, 2010 by Joachim



I'd like to use circular buffers as input arguments to the intrinsic (DSP Run-Time Library) function crosscorr_fr16(). Is that possible?




fract16 a[512];

fract16 b[512];

fract16 c[256];


//Fill up a and b with data....


crosscorr_fr16(a, b, 512, 256, c);


What if a and b were circular buffers?


As I see it, crosscorr_fr16 only caclulates crosscorr of starting at the element x of the input array &(a[x]) and there is no way to handle wrap around if a were a circular buffer. I don't want to spend time copying "snapshot" values from a circular buffer into an array.


On the other hand, I think this must be a quite common task to calculate cross-correlation of data from FIFO (circular) buffers, so there's got to be a efficient solution. As I understand it, the intrinsic crosscorr_fr16 is the most efficient way to calculate the cross correlation.


Any ideas anyone?