## AT32UC DSP ASF - Is there a dot product available?

4 posts / 0 new
Author
Message

Hello,

I need to implement a FIR filter for streamed data. I thought i may use the dsp libraries to do so. Since it is streamed data, i would like to calculate the output of the FIR filter y[n] every time a new data sample x[n] is available. Unfortunately, the FIR filter implemented in the dsp library is not of use to me, since this implementation is ment to filter a whole data input vector.

The only thing i need would be a dot product (not the dot multiplication available in the dsp lib). Is there any available? Or do i have to construct a dot product by use of the dot multiplication function and sum up the resulting vector? Is this a good approach or is there a better way to do it?

Pani87 wrote:

Hello,

I need to implement a FIR filter for streamed data. I thought i may use the dsp libraries to do so. Since it is streamed data, i would like to calculate the output of the FIR filter y[n] every time a new data sample x[n] is available. Unfortunately, the FIR filter implemented in the dsp library is not of use to me, since this implementation is ment to filter a whole data input vector.

The only thing i need would be a dot product (not the dot multiplication available in the dsp lib). Is there any available? Or do i have to construct a dot product by use of the dot multiplication function and sum up the resulting vector? Is this a good approach or is there a better way to do it?

I'm not sure I understand exactly what you are trying to do but if all you need is a function to calculate the dot product of two 3-component vectors, use the algebraic formula. It's as simple as:

`a·b = x1*x2 + y1*y2 + z1*z2`

https://en.wikipedia.org/wiki/Do...

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

You are right, that is exactly the algebraic formula of the dot product ;)

I am interested in doing this calculation pretty quickly and efficient. Usually DSPs offer commands capable of multiplying two numbers and add the result to another number in only one cicle. This way one can calculate liner algebra equations, like the dot product, very fast. However, i am not interested in programming that myself in assembler. So i was wondering, if there is such a function already available. I guess i go the easy way and use the dot multiplication and sum the vector up afterwards seperately... and just hope this is fast enough ;)