I want to do a 3-dimensional FFT on this function $\frac{\cos (x) \cos (y) \cos (z)-\sin (x) \sin (y) \sin (z)}{\left((1.0001+\sin (y)+\cos (z))^2+(0.0001+\cos (x)+\sin (z))^2+(0.0001+\sin (x)+\cos (y))^2\right)^{3/2}}$ for it looks intractable via analytical Fourier expansion. Let's denote the number of numerical sampling points in each dimension as $N$.

FourierParameters -> {a, b}. $a=-1$ for $1/N^3$ normalization in conformity with commonly used coefficients in FourierSeries. $b=-1$ for forward, not backward transform.

nn = 10; step = (2 \[Pi])/nn; mx0 = 1.0001; my0 = 0.0001; mz0 = 0.0001; 
data = Table[ ( Cos[x] Cos[y] Cos[z] - Sin[x] Sin[y] Sin[z])/((mz0 + Cos[y] + Sin[x])^2 + (mx0 + Cos[z] + Sin[y])^2 + (my0 + Cos[x] + Sin[z])^2)^(3/2), {x, 0, 2 \[Pi] - step, step}, {y, 0, 2 \[Pi] - step, step}, {z, 0, 2 \[Pi] - step, step}];
s = Fourier[data, FourierParameters -> {-1, -1}]; s[[1, 1, 1]]

As far as I've tried, using Fourier[ ] in Mathematica, the transformation result doesn't converge even when $N=500$, oscillating drastically with respect to $N$ in fact. Besides, I also tried some FFT routine from MKL library by C++, which showed similar behavior.

I checked the programs with many other non-singular functions, they turned out to be good. So I guess the problem may be caused by the special form of the singular function (denominator can be zero at some points). I tried $\frac{1}{0.9-\sin{(x+y+z)}}$. It doesn't oscillate so much, but still considerably.

Can anyone shed some light on this problem? Thanks in advance!

  • 1
    $\begingroup$ I am not nitpicking, but FFT is an algorithm; DFT is a transformation; Other than that - Interesting question - +1 $\endgroup$
    – Sektor
    Jun 7, 2014 at 16:21
  • $\begingroup$ Also, what is the reason behind using parameters {-1, -1} ? $\endgroup$
    – Sektor
    Jun 7, 2014 at 16:29
  • $\begingroup$ @Sektor Thank you. Please see the new version. $\endgroup$
    – xiaohuamao
    Jun 7, 2014 at 16:35
  • $\begingroup$ And what exactly are you trying to achieve by doing this ? Are you performing some kind of analysis ? $\endgroup$
    – Sektor
    Jun 7, 2014 at 19:11
  • $\begingroup$ @Sektor This function has physical meaning in its own right. My calculation is based on its Fourier transformation. $\endgroup$
    – xiaohuamao
    Jun 8, 2014 at 4:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.