First signs of success
Yesterday, I integrated CUDA into the project which went rather easily, except that I had to update some graphics drivers on my dual-booted Ubuntu to get my Nvidia 1070 running.
According to CUDA specification, the result of inverse cuFFT is un-normalized, meaning that the result is scaled by the input size; in my case, 512x512.
iFFT(FFT(A) = length(A) * A
This means that the result of the cuFFT operation has to be normalized and divided by the problem size. However after normalization, the result did still not look like I expected.
It was like every other pixel were a little darker. And after scratching my head for a while I finally found a master's thesis by Fredrik Larsson (2012) named "Deterministic Ocean Waves", where he intuitively and clearly explains the wave transformation using FFT.
In equation 4.6, he clearly shows how the translation from the frequency domain h-tilde(k, t) to the spatial domain h(q, t) essentially alternates signs due to the definition of k and that q = rD / R.
Kommentarer
Skicka en kommentar