discrete Fourier transform

As an answer to my code I will get a periodic discrete time dependent function called "data" which I want to get a Discrete Fourier transform of it using just one period of it,but I think some thing is wrong with the way I do Fourier transform.here is my code:

a = 0.05; L = 15; T = 20 \[Pi]; hdc = 2.1;
sol = NDSolve[{a*D[u[t, x], t] == D[u[t, x], x, x] - Sin[u[t, x]],
u[0, x] == 0, Derivative[0, 1][u][t, 0] == Tanh[t/0.01]*hdc,
Derivative[0, 1][u][t, L] == 0}, u, {t, 0, T}, {x, 0, L},
MaxStepSize -> 0.005, MaxSteps -> 10^6];
q := NIntegrate[(
Evaluate[First[Derivative[1, 0][u][tp, x] /. sol]])^2, {x, 0, L},
Method -> "LocalAdaptive", MinRecursion -> 50,
MaxRecursion -> 100];
data = Parallelize[Table[q, {tp, 25.8, T, 0.5}]];
ListLinePlot[data, PlotRange -> All]
ListLinePlot[Abs[Fourier[data]]]


-

migrated from stackoverflow.comSep 12 '12 at 11:30

This question came from our site for professional and enthusiast programmers.

On a core-i7 extreme it does not take much time to evaluate around 124 sec using LaunchKernels[10]. But its very memory hungry even with 64GB RAM I went more than 80% few times during the computation. But now I can offer the onlooker those plots ... –  PlatoManiac Sep 12 '12 at 13:23
Guys,I do get the same result on my machine,but I think this Fourier analysis doesn't make sense,at least my supervisor says so.he says I have to tell the program that my function is periodic,so that the Fourier transform of it should go to zero for t infinity. –  Ahmad Sheikhzada Sep 12 '12 at 13:53
@AhmadSheikhzada Editting your code by involving MemoryConstrained may help lots of people who would like to run your code! :P –  drN Oct 14 '12 at 23:08
@AhmadSheikhzada I am curious about the computational resources that are available to you. Could you please expand on that? Thanks! –  drN Oct 15 '12 at 18:03
@AhmadSheikhzada Did you consider plotting your DFT data using MatrixPlot. It makes it look neater. Here's my question as an example. Noted that I also used a Hard threshold value to obtain these plots. –  drN Oct 15 '12 at 20:23

Assuming your calculated data are correct, the first ListLinePlot shows what is an approximate delta-function, that is, a single isolated spike. The Fourier transform of a delta-function produces a flat spectrum, that is, a constant at all frequencies. Your second ListLinePlot of Abs[Fourier[data]] looks like a constant, plus or minus some noise. Thus, it looks fine to me...