AT32UC DSP ASF - Is there a dot product available?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

 

Thanks in advance!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

 

Thanks in advance!!

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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 ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know specifics of the UC3 but surely if you are using C or C++, the compiler would get math operations correct and faster (read as less cycles) than most people could do in assembly? I wouldn't WANT to write the dot product in assembly either but why would you need to? Let the compiler do the heavy lifting.

 

I've only wanted to do one thing in assembly and that's VGA video generation... and that was a learning process.

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com