Hello Engineers!

I'm currently working for the first time with a DSP due to my master's thesis which is about active noise cancellation.

I've came across the problem to compute the dot product of a regular array and one array used as circular buffer. My solution to this until now looks as following:

#define FLOAT_TO_INT_FACTOR 2147483648.0 float floatToSend; float dm coefficients[COEFF_COUNT]; float pm templateInt[COEFF_COUNT]; //being my circular buffer int templatePosition; //here, new coefficients are calculated for each new sample received (from error microphone) floatToSend = vecdotf( coefficients, &signalTemplate_int[templateIntPosition], COEFF_COUNT - templateIntPosition ); floatToSend += vecdotf( &coefficients[COEFF_COUNT - templateIntPosition], signalTemplate_int, templateIntPosition ); templateIntPosition = circindex(templateIntPosition, 1, COEFF_COUNT); *pTXSP2B= (((int)(floatToSend * FLOAT_TO_INT_FACTOR)) * 256) >> 8;

As far as I understand, this is somewhat inefficient because of uneven word boundariers and therwith the use of SISD :/

But now I came across this thread: http://ez.analog.com/message/7821#7821 and from what I understand, it is somehow possible to do the crosscorrelation directly on a circular buffer... at least with a blackfin. Does this also stand for vecdotf() and a SHARC ADSP-21369? And if yes, could you please give me a hint on how to realize it?

thanks,

Markus

Hi,

There is a cross correlation function for SHARC similar to the Blackfin function you point out. Please refer to the crosscorr function in the SHARC runtime library manual at the following link.

http://www.analog.com/static/imported-files/software_manuals/50_21k_rtl_mn_rev_1.5.pdf

The assembly code for this function crosscor.asm can be found in the VDSP tools. This function also uses the i0 and i3 dag registers as the input array pointers. So the theory stated for Blackfin about circular buffering and call preserved registers applies to this as well.

Hope this helps.

Thanks,

Divya