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

Signal Processing FFT help

  1. Mar 26, 2008 #1
    Hello all. I am working on a problem for class that is taking some time data and changing it to frequency data. I am using excel and the fast fourier transform(fft).

    I am having a problem graphing the results. I am very new to signal processing.

    I am only given the data which is 1024 points long.
    I will only ask for help with one because if I figure this one out I can do the rest.

    The period is .117. Making the sampline rate 1/.117.

    I have the two columns of data here is an example.
    The first column is (1*(1/.117)/1024) and the second is the fft values.

    pres43 abs imag
    0.006643282 162509.4667
    0.013286565 388.025981
    0.019929847 600.4277992
    0.026573129 499.1078937
    0.033216412 447.4588355
    0.039859694 102.7576392
    0.046502976 276.7567742
    0.053146259 358.0531147
    0.059789541 289.5977569
    0.066432823 129.8177899
    0.073076105 91.85556182
    0.079719388 250.3116294
    0.08636267 35.77585877
    0.093005952 218.271273
    0.099649235 216.1229107
    0.106292517 215.5078932
    0.112935799 110.6895935
    0.119579082 153.2837982
    0.126222364 194.9400366
    0.132865646 96.83955867

    My problems is that I don't know how to graph the values correctly. The graph as it stands is not right. Someone told me that I have to remove the DC zero values? I do not know how to do that and that is why I am asking for help.

    Thank you
  2. jcsd
  3. Mar 26, 2008 #2
    May be useful

    This may be helpful, it may be completely wrong... you presumably understand it better than I do!

    I've never been taught fourier transforms, but I've read about them and used them occasionally - I can't quite make sense of you're data, but heres my basic understanding of FFT & graphing it.

    Data in
    y = x(t) {REAL amplitude as function of time}

    Data out
    p = A * g(Bf) {COMPLEX "phasors" as function of frequency; A & B are constants}

    |p| = amplitude of wave with frequency f
    arg p = phase offset of wave with frequency f

    Presumably, you want to produce a graph of amplitude vs. frequency - so by working out the constants A & B, you can produce a table of amplitudes (and if needed, phase offsets) for corresponding frequencies. Once this is done, a simple scatter or line graph will give you what you want (possibly using logarithmic axes).

    Also, if your sample rate is too low, or a strong wave with period larger than the data length exists, then you may get a large rise in amplitude towards the lower frequencies.
    Last edited: Mar 26, 2008
  4. Apr 1, 2008 #3
    if you have N samples in time with Ts(Time sampling or samping rate) so you can write the time like
    in the frequency demain, you have Fs=1/Ts, and you have Nfft=1024, so the frequency can be written like
    Now you can plot your data in time & frequency:
    plot(t,data);// in time
    plot(f,fft(data,Nfft)); // in frequency.
    good luck.
  5. Apr 1, 2008 #4
    this is in matlab?
  6. Apr 1, 2008 #5
    Yes if you want but if you are not familiar with matlab just use
    f=(0:Nfft-1)*Fs/Nfft to get the spectum bins at right frequencies.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook