Scrawk / Phillips-Ocean

A ocean using Phillips spectrum in Unity
MIT License
279 stars 39 forks source link

Fourier Transform is it inverse or forward? #1

Closed TheCelticGuy closed 4 years ago

TheCelticGuy commented 4 years ago

Hey

Just been looking through the code and the original blog post, i am still unsure if the Fourier transform being used is an iFFT or an FFT - do you happen to know which one it is ?

I get the impression that it converts frequency to time domain so it would need iFFT but then the original blog doesn't do the inversion so its a bit confusing..

Scrawk commented 4 years ago

It’s going from frequency to time so yes it’s technically iFFT.

TheCelticGuy commented 4 years ago

Thought so, Keith's blog seems to never mention that it is IFFT and refers to it as FFT. But according to the IFFT equation you have to divide the result by the resolution N aka 1/N or in the 2D case by 1/N^2:

https://www.rfwireless-world.com/Terminology/IFFT-vs-FFT.html

But neither you nor Keith's blog seem to do this - only permutate the signs - so i am a bit confused. The math is rather difficult to grasp as it is lol !

Have i misunderstood the code some where or missed where you divide the results ?

Scrawk commented 4 years ago

I made this a long time ago so cant really remember and I am no expert on the subject so dont know.

TheCelticGuy commented 4 years ago

Ah, fair enough :)