0

I am facing an interesting problem: I have a signal in the time domain. In order to avoid discontinuities at the edges of the signal --- which would lead to artifacts when calculating the FFT --- I apply a window function, like e.g. hann or hamming. Then I perform the FFT of this windowed signal.

To preserve the energy of the signal after the FFT, I calibrate the FFT of the windowed signal with the RMS of the window function. However, the strange thing is that the energy (=area under the curve) of the windowed signal in the frequency domain is substantially different (about a factor of 2) compared to the FFT of the unwindowed signal.

Do you have an idea where this issue could originate from?

Thanks a lot in advance!

2 Answers2

1

So you think that the energy of the windowed signal in the frequency domain equals to the original signal multiplied by a certain value related to RMS of the window function, which is wrong. According to Parseval's theorem, the total energy of a signal can be calculated by summing power-per-sample across time or spectral power across frequency:

$$ \sum_{n=0}^{N-1} |x[n]|^2 = \frac{1}{N}\sum_{k=0}^{N-1}|X[k]|^2 $$

Hence I'm going to prove your statement wrong in the time domain.

The energy of a windowed signal $w[n]x[n]$ is

$$ \sum_{n=0}^{N-1} |w[n]x[n]|^2 = \sum_{n=0}^{N-1} |w[n]|^2|x[n]|^2 \neq C\sum_{n=0}^{N-1} |x[n]|^2 $$

where $C$ is a constant. The above inequality holds true as long as the window function $w[n]$ is not a rectangular window.

robert bristow-johnson
  • 20,661
  • 4
  • 38
  • 76
ZR Han
  • 3,228
  • 6
  • 16
  • Wow that's very interesting - so that shows probably the main problem here. Thank you very much for your help, that's really helpful! I am wondering, however, how one could then calculate e.g. the PSD of a signal in the frequency domain. If I had a periodic signal, I could just calculate the fft of the signal and calculate |fft(signal)|^2. But what if the signal is not periodic so that a window function becomes necessary? Is there a way that still find the correct PSD even if a windowfunction is used for the signal in the time domain? – Sandro Camenzind Apr 09 '21 at 11:17
  • If $N$ is very large and you make some assumptions about the orthogonality of $w[n]$ to $x[n]$, there is an assumption you can make about $C$. – robert bristow-johnson Apr 10 '21 at 13:58
0

When computing the PSD of a windowed function we must account for the increased width and hence overlap of the main lobe of the windows kernel. A single tone does not span multiple bins and thus the computed RMS level will be accurately determined from the coherent loss of the window, however a signal that has a spectral density that spans multiple bins (such as white noise) will result in an overestimate of the rms level due to this double counting within each bin.

I detail this effect and the computations that can be used to accurately measure the rms signal level from a windowed DFT here in this post:

Find the Equivalent Noise Bandwidth

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135