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

Discrete Fourier Transforms without using FFT function

  1. Nov 5, 2011 #1
    This is what I have done so far
    Code (Text):

    t = -5:.01:4.99;   // this give us our rect function from -.5 to .5
    x = abs(t) <= .5;
    subplot(2,1,1)     // creates a subplot for the rect function
    axis([-2 2 -1 2])  // sets the axis

    T_s = .001;       // The calculation of the discrete Fourier Transform
    F_s = 1./T_s;
    N = 1000;
    n = -N/2.:1.:(N/2.)-1;
    f = -F_s/2.:1.:(F_s/2.)-1;

    X_f = T_s*x*exp(-1i*2*pi*f'*n*T_s);

    z = fft(X_f);
    Here is the the formula for the Fourier transform. I expect to get a sinc function, which I am but it doesn't match it by scale.

    [PLAIN]http://img580.imageshack.us/img580/1699/fourier.jpg [Broken]
    Last edited by a moderator: May 5, 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?