user2464424
user2464424

Reputation: 1616

Strange FFT peaks when working with many tight frequencies

I'm using a slightly modified version of this python code to do frequency analysis: FFT wrong value?

Lets say I have a pack of sine waves in the time domain that are very close together in frequency, while sharing the same amplitude. This is how they look like in the frequency domain, using FFT on 1024 samples from which I strip out the second half, giving 512 bins of resolution:

Blue: rectangular window. Pink: Nuttall window

This is when I apply a FFT over the same group of waves but this time with 128 samples (64 bins):

Blue: rectangular window. Pink: Nuttall window

I expected a plateau-ish frequency response but it looks like the waves in the center are being cancelled. What are those "horns" I see? Is this normal?

Upvotes: 3

Views: 882

Answers (2)

hotpaw2
hotpaw2

Reputation: 70743

Sine waves closely spaced in the frequency domain will occasionally nearly cancel out in the time domain. Since your second FFT is 8 times shorter than your first FFT, you may have windowed just such an short area of cancellation. Try a different time location of shorter time window to see something different (or different phases of sinusoids).

Upvotes: 1

Bruce Dean
Bruce Dean

Reputation: 2828

I believe your result is correct. The peaks are at ±f1 and ±f2), corresponding to the respective frequency components of the two signals shown in your first plot.

I assume that you are shifting the DC component back to the center? What "waves in the center" are you referring to?

There are a couple of other potential issues that you should be aware of:

  • Aliasing: by inspection it appears that you have enough samples across your signal but keep in mind that artificial (or aliased) frequencies can be created by the FFT, if there are not enough sample points to capture the underlying frequency. Specifically, if your frequency is f, then you need your data sample spacing to be at least, Δx = 1/(2*f), or smaller.
  • Windowing: your signal is windowed (has a finite extent) so there will also be some broadening, ringing, or redistribution of power about each spatial frequency due to edge affects.
  • Since I don't know the details of your data, I went ahead and created a sinusoid and then sampled the data close to what appears to be your sampling rate. For example, below is a sinusoid with 64 points and with a signal frequency at 10 cycles (count the peaks):

    enter image description here

    The FFT result is then:

    enter image description here

    which shows the same quantitative features as yours, but without having your data, its difficult for me to match your exact situation (spacing and taper).

    Next I applied a super-Gauss window function (shown below) to simulate the finite extent of your data:

    enter image description here

    After applying the window to the input signal we have:

    enter image description here

    The corresponding FFT result shows some additional power redistribution, due to the finite extent of the data:

    enter image description here

    Although I can't match your exact situation, I believe your results appear as expected and some qualitative features of your data have been identified. Hope this helps.

    Upvotes: 5

    Related Questions