Operations with matrices


#1

I had this bizarre idea to write some kind of "vector space function" to be used as a distortion object.
The basic concept is to provide two signals in input (x1,x2), which are fed to a vectorial function (f1(x1,x2),f2(x1,x2)) that returns a new set of coordinates (y1,y2)

The function i chose to use is a multivariable polynomial:

fi(x,y) = a11 + a21x + a31x^2 + y(a12+a22x+a32x^2) + y^2(a13 + a23x + a33x^2)

which can be easily expressed as a matrix product (in fact i got the formula above solving the matrix product):

[1 ,x ,x^2 ] X [ aij ] X [1 , y, y^2]T
(which would result in 36 multiplications when considering this particular product)

now, how can i perform such operation in axoloti world in an efficient way?
I've read somewhere that the fpu processor is capable of handling matrix operations. If that's the case, are the functions exposed at patcher level?

If that's not the case, how could i approach the problem in a non-painful way?


#2

The FPU does not do matrices. There are some SIMD ("single instruction multiple data") instructions but in integer only.
There are matrix functions in CMSIS/DSP_Lib, but not linked in the firmware, I don't think they will offer a significant benefit for 3x3 matrices.
Just expressing the multiply/adds in regular code will be fine if you do floating point.


#3

Oops, you'll have to forgive my lack of jargon, i meant the DSP functions.

However, i just coded the object using SMMUL and friends and it works quite nicely without excessive dsp load (i just had to cheat with numbers to get a decent scaling). 4x4 matrix.

I think i might try with a 6x6 ( i can already see the dsp bar shooting in the stars)