Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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!

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.