Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to solve a simple mass-dashpot-spring system $$m\ddot{u}(t) + c\dot{u}(t) + ku(t) = F(t)$$ by making use of the Fourier transform defined as $$\tilde{f}(s) = \int_{-\infty}^{\infty} f(t) \, \mathrm{e}^{-\mathrm{i} (2 \pi s) t} \mathrm{d}t$$ such that the ODE transforms into $$-(2 \pi s)^2 m \tilde{u}(s) + \mathrm{i} (2 \pi s) c \tilde{u}(s) + k \tilde{u}(s) = \tilde{F}(s)$$ to eventually solve $$\tilde{u}(s) = \frac{\tilde{F}(s)}{-(2 \pi s)^2 m + \mathrm{i} (2 \pi s) c + k}$$ Say I have the forcing $$F(t) = \left\lbrace\matrix{\cos(t) & 0 \leq t < \pi/2 \\ 0 & \text{otherwise}}\right. \quad \rightarrow \quad \tilde{F}(s) = \frac{\mathrm{e}^{-\mathrm{i} \pi^2 s} + \mathrm{i} (2 \pi s)}{1-(2\pi s)^2}$$ accept the initial conditions $$u(0)=0, \; \dot{u}|_{t=0} = 0$$ and have the parameters $$m=1.3, \; c=0.6, \; k=1.7$$ Now, I want to transform it back to the time domain using the discrete Fourier transform. I think the basic idea is to compute solutions $\tilde{u}$ for several values of $s$ like this. If I plot the vector containing the complex valued solutions this results in (red - real, green - imaginary)

Then when using Maple's InverseFourierTransform function on the resulting vector I obtain rubbish:

What am I doing wrong here?

share|cite|improve this question
Why are you using a discrete Fourier transform? Is this meant to be an approximation? – joriki Feb 19 '13 at 11:27
Yes, I'm actually trying to solve a FEM system, so this is just a simplified problem to get started... I know this can be done perfectly by hand though. – demorge Feb 19 '13 at 11:43
Just a guess (as I do not know Maple), but perhaps there is some shifting of the data going on in Maple. Something tells me, though, that is not the entire story, but at least it is a start. – Ron Gordon Feb 19 '13 at 12:04
The plot does look like a decaying wave. Maybe it simply does not resolve in the graph (i.e., the number of points is too low?) – user53153 Feb 21 '13 at 2:40
@rlgordonma: You are right, after swapping the left and right parts of the vector all is well. I suggest you turn your comment into an answer so I can accept it. – demorge Feb 21 '13 at 8:29
up vote 2 down vote accepted

Many times in programs like Maple, the Fourier transform routines shift the data so that what you would expect to be the center frequency is actually at the beginning of the array. In this case, you need to shift the data by half a cycle in the array to recover your expected behavior.

share|cite|improve this answer

Your Answer


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

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