1

I know we can use window function to decrease leakage phenomenon by making the end of a non-periodic signal to be zero at both end, so that to make it like "continuous and periodic" when doing fft.

However, when we multiply window function with original signal (ex: w(t)xs(t)), it's like doing convolution (w(f)*s(f)) in frequency domain, just like w(f) function slide from left to right and integrate with the area with s(f).

And my question is that since it would still integrate the area which is not the real frequencies of the original signal, and have values after convolution, how could this method really suppress those frequencies?

What make me confused is because I think using window function is the same as the method of doing FIR, which also multiple a window function with the ideal low pass signal in frequency domain. And the FIR characteristics are related to how many areas during integration (ex: the size of transition band).

Thank you very much!

Yui
  • 27
  • 2

3 Answers3

0

You are right that the effect of windowing is the same for the design of FIR filters and for spectral analysis. You will always have a compromise between main lobe width and relative side lobe level (relative to the main lobe). The main lobe width determines the frequency resolution, and the relative side lobe level determines the amount of spectral leakage. A rectangular window has a narrow main lobe (desirable), and relatively large side lobes (undesirable). Other windows achieve different compromises between those two parameters. In FIR filter design, the equivalents to frequency resolution (main lobe width) and leakage (side lobe level) are transition band width and stop band rejection.

You should read the classic paper by Fred Harris: On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform.

Matt L.
  • 89,963
  • 9
  • 79
  • 179
  • Just a quirk, but he prefers "fred harris". I agree that this is the seminal paper on the topic. I wish someone would make a proper PDF of it rather than the low quality image ones that are available. – Cedron Dawg Aug 05 '18 at 15:36
  • 1
    @CedronDawg: I replaced the link with a much better quality pdf file. – Matt L. Aug 08 '18 at 11:28
  • Thanks, not only is that better quality, it is also searchable which is what I meant by a proper PDF. The text is not sequential though in a columnar sense, making cutting and pasting difficult, but it is a huge improvement over the poorly imaged version. As to the point I made to @StanleyPawlukiewicz, check out footnote 1 on page 60: 'The correct name of this window is “Hann.” The term “Hanning” is used in this report to reflect conventional usage. The derived term “Hann’d” is also widely used.' – Cedron Dawg Aug 08 '18 at 14:20
0

Perhaps a Simple example using a hanning window might be helpful

Let's compare the DFT of a Hanning (or Von Hann) window and what you get by doing the convolution in the frequency domain.

A Hanning window can be reduced to 3 terms in the frequency domain

$$ \hat{X(k)}_{\text{Hanning}}= .5 X(k) + .25 ( X(k-1) + X(k+1)) $$ where $X(k)$ are the DFT bins of a time domain uniform window and the k are wrapped around at the edges. $\hat{X(k)}_{\text{Hanning}}$ is the DFT bin value of a Hanning windowed time signal. For this example $x[n]=1$ for $n=0,1,2,\dots 127$, and zero otherwise.

clear all
x=fft(boxcar(128))';
xh=fft(hanning(128))';
figure(1)
 y= .5*x + .25*( [x(128) x(1:127)]+[x(2:128) x(1)] );
plot(fftshift(abs(y)),'x')
title('Frequency Domain Hanning')
figure(2)
plot(fftshift(abs(xh)),'x')
title('time domain Hanning')

[DFT of Hanning wido by convolution in the frequency domain][DFT of Hanning widow by convolution in the frequency domain

[DFT of Hanning window taken in the time domain][DFT of Hanning window taken in the time domain]

The plots are identical which shows that you can convolve in the frequency domain.

Unlike time domain convolution, we have all the frequency domain terms so the convolution isn't "causal". Windowing has the effect of smoothing in the frequency domain. Each term is smoothed so the symmetry in the frequency domain is preserved. The original symmetry and periodic nature of the DFT ensures that even at the edges, in the frequency domain, they are neighbors.

A time domain window acts on all the frequencies, negative and positive. The term "real frequencies", in my opinion, contributes to your confusion.

  • Just a nitpick. "Hanning" is not the proper name, it should be "VonHann". "Hanning" comes from the similarity to "Hamming" which is a different window type. It doesn't help that the Python library reinforces this misnomer. Not that much of a biggie to me, but I have found in various forums it is somewhat of a hot button issue for some folks. FYI. – Cedron Dawg Aug 05 '18 at 15:34
  • that’s what the mathworks calls it. proper or not, the name sticks –  Aug 05 '18 at 16:18
  • I don't disagree. Even harris called it that. I am not going to lose any sleep over it. I was just pointing it out as there are some members of the community who have an issue with it. – Cedron Dawg Aug 05 '18 at 16:38
  • There are these 2 arrows, one goes up and the other goes down at the top left of the answer. If anyone is deeply offended because I used hanning, please feel free to down vote the answer. Otherwise I would prefer the answer be judged on its signal Processing merits. –  Aug 05 '18 at 17:20
  • It would be a shame for someone to downvote you for that. However, your "time domain Hanning" chart should look like a one plus cosine or a sine squared graph, it seems you have duplicated the frequency graph. – Cedron Dawg Aug 05 '18 at 17:44
  • The top graph is the DFT of the Hanning window. The bottom graph is the convolution in the frequency domain. They are meant to be identical –  Aug 05 '18 at 18:15
  • Hi, thank you for showing the example with figures! I would like to ask two more questions:
    1. So the "suppress" actually means to "smooth" those frequencies we don't want(like canceling those very small peaks), and the leaving big peak could approximate the real frequency of original data? But in FIR, my thought is when applying a window function, there would be more "ripples" after convolution in frequency domain, then what's the difference between to be "smooth" and have "ripples" ?
    – Yui Aug 06 '18 at 05:05
  • I can't realize well about this "the original symmetry and periodic nature of the DFT ensures that even at the edges, in the frequency domain, they are neighbors.", what does the "neighbors" mean here?
  • Sorry for these stupid questions, and thank you very much again! :)

    – Yui Aug 06 '18 at 05:05
  • The periodic nature of the DFT is best explained in a textbook. That’s the nature of cyclic convolution. Not all FIR filters ripple the same. This is part of the effective bin width and sideline trade off. The Fred Harris paper mentioned in MatL answer is worth reading and explains much. DFT is mostly in Signal Processing used when there are many spectral components, a dense spectrum. –  Aug 06 '18 at 13:09