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$. Here's the Mathematica code.

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 Fast Fourier Transform routine from either C++ MKL library or Mathematica, the transformation result doesn't converge even when $N=500$, oscillating extravagantly with respect to $N$ in fact. 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 Answer 1


It's a question of function spaces. If your function is in $L^2$, then you know that you can approximate the function using a Fourier series because the Fourier basis (i.e., the sines and cosines) are dense in $L^2$. In other words, you know that if you take more and more terms of the series, then you will approximate the function better and better.

On the other hand, if your function is so singular that it doesn't belong to $L^2$, then all hope is lost: you cannot expect the Fourier series to converge.

  • $\begingroup$ Thanks. So you mean this function is not square integrable? I am not sure by myself. $\endgroup$
    – xiaohuamao
    Commented Jun 8, 2014 at 3:35
  • 1
    $\begingroup$ I don't know. You'll need to check. $\endgroup$ Commented Jun 8, 2014 at 4:08

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.