Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Manual Fourier Transform of exp(-t^2 /tau)

  1. Feb 20, 2014 #1
    Hello all,
    I have got into a confusion. In the function below, I need to numerically integrate the function with respect to (q) after the Fourier transform.
    [tex]f(t)=e^{-Dq^2 t}[/tex]
    I use two approaches. Approach-1 is working, but Approach-2 does not give the same result, and I wonder what could be the mathematical explanation, or maybe it's because of the Matlab algorithms that I use.

    1. First approach, to analytically solve the FT with Mathematica:
      [tex] 2 \int_0^{\infty } e^{-D q^2 t} \cos (t \omega ) \, dt = \text{ConditionalExpression}\left[\frac{2 D q^2}{D^2 q^4+\omega ^2},\left| \Im(\omega )\right| \leq \Re\left(D q^2\right)\land \Re\left(D q^2\right)>0\right][/tex]
      take the result function and numerically integrate over (q) in Matlab using 'quadl' function:

      Code (Text):

      q1=1e6;     %integ. low limit
      q2=3e10;    %integ. hi limit
      D=8e-12;    % a constant

      omega = 2*pi*logspace(-2,10,50); %ang.frequency

      for i = 1: length(omega)
          I_w(i) = quadl(@(q)Distr(q,omega(i),D), q1, q2);
      where 'Distr' contains the function 2Dq^2 / (q^4 + omega^2)

      finally plot it as a function of ω:
      https://dl.dropboxusercontent.com/u/12535433/PhysicsForum/01.jpg [Broken]

    2. In the second approach, I take the f(t) function (better to say f(t,q) )and try to numerically solve the double integral in Matlab (dblquad function):
      Code (Text):

      t1 = 0;
      t2 = 1E6;

      for ii = 1: length(omega)
          J2_w(ii) = dblquad(@(q,t) exp(-D .* q.^2 .* t.^a) .* cos(omega(ii).*t), q1,q2,t1,t2);
      and plot it as a function of ω:
      (This double integral takes too long)
      loglog plot
      https://dl.dropboxusercontent.com/u/12535433/PhysicsForum/Graph2.BMP [Broken]

      semilogx plot

      https://dl.dropboxusercontent.com/u/12535433/PhysicsForum/Graph1.BMP [Broken]

      it looks like the function shows an oscillatory behaviour at the high frequency domain. I wonder if this could be an artifact due to the 'dblquad' function in Matlab. I also tried to decrease the tolerance, because of the cosine, it could be the problem of sampling that it cannot sample at the high frequency.

    I appreciate any help/comment/suggestion.
    Thank you.

    P.S. I would happily upload the matlab .m file if required.
    Last edited by a moderator: May 6, 2017
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted