Notifications
Clear all

[Closed] Wave functions, fourier transforms etc

 eek

So decided to share to simple fourier transforms for you guy’s to use if you need them:

Square wave:

A sgn [sin(2pi(x-x0/T)] – so sgn is a sign function (it denotes n/|n| or n/ abs(n))

   
T = time interval such as NT, F or slidertime
A = amplitude
x,x0 = amount and offset
 
n = (sin((2*pi*(x-x0))/T))
A* n/abs(n)

Sawtooth wave:

x/2L – |_ x/2L _| – |_ x/2L _| denotes the floor function of x.

 
x = f -- time 
L = 1 --amount
 
x/2*L - abs (x/2*L)

Triangle Wave:

This is easy so i dont need the pure math, because its the same:

 x = F 
(2/pi)* asin (sin(pi*x))

Full rectified sine wave:

This gets complicated as it need summation of i,0= inf i.e from 1 to infinity so i do a little less.

 t = F 
A = amplitude
n = 1
 
e = 0
for n = 1 to 30 do
(
e = e + (cos(n*omega*t))/((n^2)-1))
)
 
((2*A)/pi)-((4*A)/pi) * e

I’ll put some more up if you guy’s need them.

cheers,

3 Replies

Thank you for having shared your knowledge, eek

Thanks eek,

I’m not too familiar with Fourier transforms… I know that they use them in the new fluid solvers we’re seeing nowadays to ease calculation of the vector field forces, and I’ve also seen FT’s used in image processing to remove granularity and other irregularities, but I still don’t know of any practical uses for guys like us in MXS. I’ve gotten by with using regular old sin/cos for any wave-like animation I need, could you give a practical example of how to use FT’s in MXS?

 eek

well i used a full rectified sine wave to make a box rotate on its edges, by plugging in a modular function of 90 over its rotation, and the rectified sine on its z axis. The square wave, triangle all good for robot type stuff.

remember they dont have to be animated, you can use there value to drive a setting, like on/off for example.