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

I am using an FFT package (GFT) to analyze a signal from a pressure

  1. Jul 6, 2011 #1
    I am using an FFT package (GFT) to analyze a signal from a pressure sensor. I am unsure of the results I am getting, so I decided to try to verify the FFT package using a known input.

    I am using a signal generator to produce a sine wave of +/- 5V @ 5 and 100 Hz.

    When I run the FFT on the data @ 5 Hz, the results show a peak amplitude of about 2.3 V @ 5 Hz. The max voltage from the sampled data was about 4.2 V.

    When I run the FFT on the data @ 100 Hz, the results show a peak amplitude of about 1.7 V @ 100 Hz. Max voltage from the sampled data was about 4.9 V.

    What results should I be seeing from the FFT analysis? I thought that if I input sine wave data at a certain peak voltage and frequencey that the FFT results would show that same peak voltage and frequency (i.e. 5 V @ 5 Hz in would give me an FFT result of 5 V @ 5 Hz in the frequency domain).

    Also, somebody mentioned that I might get a result of (amplitude/2) from the FFT depending on the FFT routine. What does this mean? Is that dependent on the algorithm that is used? I heard the terms 'peak to peak' and 'peak' used in reference to this. What does this mean?
     
  2. jcsd
  3. Jul 6, 2011 #2
    Re: Fft

    Are you certain your synthesized waveforms start at sin(0)=0 and have exactly n complete cycles? If not you might be getting aliasing that is confounding your results.

    You might also do a 10 Hz or 20 Hz transform on your 5 Hz signal and confirm that you get a single clean peak at 5 Hz and everything else is approximately zero. Similarly for your 100 Hz data. You need to ensure that you have complete cycles in your data to avoid introduced crud. Or you need to discover "windowing" that distorts your results somewhat, but not as much as crud will.

    In the middle of this web page
    http://mathworld.wolfram.com/FourierTransform.html
    you can see the 1/(2 Pi) scaling factor if you lump all that into only the transform or the inverse transform OR there is the 1/Sqrt[2 Pi] factor if you put equal weights into both,
    maybe that is what he was talking about, but I've never heard of a 1/2 weighting.

    So check for complete cycles, perhaps plot each to verify this, see if you get a single spike in the frequency domain, consider windowing on your real data and report back if any of this helped or if nothing did.
     
  4. Jul 7, 2011 #3
    Re: Fft

    I set up a routine to calc sine wave data, calculated data for 4 cycles of a 5V/5Hz signal, taking 4096 samples overall.

    I fed this data into my FFT routine, the result is a single peak of 2.5 V @ 5 Hz.

    I am using a Hann window function. Looks like this:

    for(i=0;i<nSamples;i++) WinFcn=0.500*(1-cos((2*M_PI*i)/(DefaultWindow-1))) ;

    Data = Data * WinFcn;


    My FFT result should be 5V @ 5Hz, correct?
    What do you mean by "You might also do a 10 Hz or 20 Hz transform on your 5 Hz signal" ??

    Also, I was going through this article on the NI website. About 3/4 of the way down, in the 'Strategies for Choosing a Window", it mentions correction factors for 'off-center components'. The Scaling Factor for a Hann window is 0.5.
    What are off-center components?
    Does this Scaling Factor have anything to do with the 5V/2 amp I am getting?

    http://zone.ni.com/devzone/cda/tut/p/id/4278#toc2
     
    Last edited: Jul 7, 2011
  5. Jul 7, 2011 #4
    Re: Fft

    For calculated data that is exactly n complete cycles you could skip using the window function (trying to eliminate possible sources of error) and see what you get.

    What I meant by "You might also do a 10 Hz..." is that if your fft only goes up to 5 Hz
    and your data is 5 Hz you are not seeing anything that might be lurking beyond 5 Hz. If you look at the spectrum up to 10 Hz or 20 Hz you shouldn't see anything other than the single 5 Hz spike (well possible rounded mountain because of the windowing). Doing that can confirm or refute that there is nothing above 5 Hz.

    I can't help you with the definition of "off-center components", perhaps Google can.

    I'm guessing the scale factor for the window likely doesn't have anything to do with the .5 you are seeing.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: I am using an FFT package (GFT) to analyze a signal from a pressure
Loading...