2
$\begingroup$

I'm trying to determine the best settings for a discrete Fourier transform on a signal with noise. Now I've stumbled on something that I can't seem to explain, I'm hoping someone can give me some insight.

My signal without noise is made of $5$ wavelengths with a frequency of $5$ MHz. Before and after the signal there is nothing. It looks like this:

signal without noise

When I perform a Fourier transform on it, as expected I get a peak at $5$ MHz.

fourier transform of signal

Now usually my signal has lots of noise, so I want to apply a window function (rectangular) to get rid of as much noise as possible. To investigate the optimum size of my window, I've plotted the height of the peak ($5$ MHz) in the FFT against the width of the window function.

Peak height as a function of window length

In this graph, at $x=0$ the window function has no width, so the entire signal is cut off. At $x=1000$, the window function is exactly as wide as the signal.

Now it turns out, slightly BEFORE $x=1000$ the FFT peak is actually HIGHER than at $x=1000$. Meaning that the FFT gives the highest peak when a tiny part of the signal is cut off.

Why is that?

I've tried thinking of possible reasons, but they're all completely guesswork:

  1. Maybe it has to do with the difference between a discrete Fourier transform and a continuous Fourier transform. I could see this show up as an artifact of the quantization of the signal.

  2. Maybe it cancels out with another property — perhaps the higher peak also becomes wider, making it blend in with noise more. If I'm only looking at my FFT at $5$ MHz however, I will still keep my advantage.

Any thoughts are appreciated!

$\endgroup$
7
  • $\begingroup$ Most likely if becomes higher because some of the side lobes have the opposite phase to the main lobe, so the main lobe has to "overshoot" to account for all of the signal in the frequency domain. All of this depends on the shape of your window function. Try a Hanning or Hamming window and quite likely (1) this effect will disappear and (2) the FFTs will have significantly smaller side lobes as well. $\endgroup$
    – alephzero
    Commented Jul 12, 2019 at 23:40
  • $\begingroup$ You are right, all of the other window functions that i've tried do not show this behaviour. This is very interesting, basically a slight cutoff from using a rectangular window will prevent most of my sidelobe leakage? $\endgroup$ Commented Jul 18, 2019 at 14:06
  • $\begingroup$ 1000 points corresponds approximatively to the time of the signal. When it is lower you have a part of the signal in the window. When calculating FFT, you integrate over signal. Since it is periodic in the window, it can somehow interfere and produce local minimum and maximums, this is what you see. $\endgroup$ Commented Mar 4 at 10:07
  • $\begingroup$ Discrete Fourier Transform is different then Continuous one. It is important to pay attention when using discrete case. There might be aliasing or even frequency splitting in the discrete case $\endgroup$ Commented Mar 4 at 10:11
  • $\begingroup$ when you use a square window in time domain, it means that you convolve with sinc function in freq domain. It has minimum and maximum. Imagine that your signal is pure sinusoid, you will have a sinc function shifted to the sinusoid frequency $\endgroup$ Commented Mar 4 at 10:13

0