DSPRelated.com
Forums

Most commonly used window functions

Started by Max November 21, 2015
The window functions that I generally see are: Hamming, Hann (why call
it Hanning?), Blackman, and Blackman-Harris (feel free to add your
favorite here). Obviously they're all still around because they're
useful somewhere.  But I'm curious about which is good for what
application.

The thing that prompted this question:..I just saw an app that had
hard-coded Blackman-Harris for doing a STFT with subsequent IFFT (B-H
used for both).   I guess that despite the wider main lobe, that B-H
has a large contrast between the peak and side-lobes. And that may
generate a less objectionable recreation of the original signal.  But
perhaps there is more to it?
On Saturday, November 21, 2015 at 10:55:05 AM UTC-8, Max wrote:
> The window functions that I generally see are: Hamming, Hann (why call > it Hanning?), Blackman, and Blackman-Harris (feel free to add your > favorite here). Obviously they're all still around because they're > useful somewhere. But I'm curious about which is good for what > application. > > The thing that prompted this question:..I just saw an app that had > hard-coded Blackman-Harris for doing a STFT with subsequent IFFT (B-H > used for both). I guess that despite the wider main lobe, that B-H > has a large contrast between the peak and side-lobes. And that may > generate a less objectionable recreation of the original signal. But > perhaps there is more to it?
Max The classic paper from Harris is available many places such as: http://utdallas.edu/~cpb021000/EE%204361/Great%20DSP%20Papers/Harris%20on%20Windows.pdf This IEEE Proceedings version has a number of numerical errors. A paper by Nuttall gives some correction and additional windows with a sensible naming convention. I recommend the Nuttall naming over the crap that has been invented for wikis. The Nuttall paper is available at many places such as: http://mwlab.pmo.ac.cn/~lzh/about_work/dspfftpaper/Some_Windows_with_Very_Good_Sidelobe_Behavior.pdf The original version of the paper is available from www.dtic.mil. Google on "ada085032". A description and evaluation of some of these and some other windows can be found at: http://compdsp.com/presentations/Dalrymple/dbd.pdf Dale B. Dalrymple
On Sat, 21 Nov 2015 13:54:39 -0500, Max <Max@sorrynope.com> wrote:

>The window functions that I generally see are: Hamming, Hann (why call >it Hanning?), Blackman, and Blackman-Harris (feel free to add your >favorite here). Obviously they're all still around because they're >useful somewhere. But I'm curious about which is good for what >application. > >The thing that prompted this question:..I just saw an app that had >hard-coded Blackman-Harris for doing a STFT with subsequent IFFT (B-H >used for both). I guess that despite the wider main lobe, that B-H >has a large contrast between the peak and side-lobes. And that may >generate a less objectionable recreation of the original signal. But >perhaps there is more to it?
Dale gave a ton of useful links and references for this area. I'll add a quick note that you're right that the general tradeoff with windows is the width of the main lobe (i.e., the "frequency resolution"), against the height of the sidelobes. The tradeoffs get more subtle with things like the rolloff rate, etc., but usually what you're trading off is the width or shape of the main lobe against the behavior of the sidelobes. There are also specialized windows like the flat-top windows where the main lobs has a flat top to prevent scalloping in tone amplitude as the frequency changes (i.e., so the amplitude stays constant, rather than dipping in between main lobes). Don't get too carried away with the details, pick something that meets your basic needs and don't worry about it until it's a problem. When it starts to become a problem, that's when you change the window and learn the differences. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On Sat, 21 Nov 2015 20:36:02 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>I'll add a quick note that you're right that the general tradeoff with >windows is the width of the main lobe (i.e., the "frequency >resolution"), against the height of the sidelobes. The tradeoffs get >more subtle with things like the rolloff rate, etc., but usually what >you're trading off is the width or shape of the main lobe against the >behavior of the sidelobes.
Hi Eric, I had been wondering whether any of the window types were increasing or decreasing in popularity. It sounds like particular windows are still being matched to certain applications. I'll probably have a better idea after I've had a chance to review the papers that Dale linked to.
>There are also specialized windows like the flat-top windows where the >main lobs has a flat top to prevent scalloping in tone amplitude as >the frequency changes (i.e., so the amplitude stays constant, rather >than dipping in between main lobes).
I had seen mention of flat top windows in the Wiki article: https://en.wikipedia.org/wiki/Window_function#Flat_top_window But I couldn't see where the word 'flat' related to their charts. I'll take another look around.
>Don't get too carried away with the details, pick something that meets >your basic needs and don't worry about it until it's a problem. When >it starts to become a problem, that's when you change the window and >learn the differences.
Actually I have had reason to apply that. In Xavier Serra's Coursera course, there are assignments where you need to optimize certain functions (STFT's, harmonic analysis). One of the variables is the window type. I've been taking a shot-in-the-dark approach without really understanding the mechanics. Most of the time, either Hann or Blackman, or Blackman-Harris would work, with very little audible difference. Hamming generally seems to work less well. Rectangular not at all. But I didn't know what the tradeoffs were.
On Sat, 21 Nov 2015 12:07:46 -0800 (PST), dbd
<d.dalrymple@sbcglobal.net> wrote:

>The classic paper from Harris is available many places such as: > >http://utdallas.edu/~cpb021000/EE%204361/Great%20DSP%20Papers/Harris%20on%20Windows.pdf > >This IEEE Proceedings version has a number of numerical errors. A paper by Nuttall gives some correction and additional windows with a sensible naming convention. I recommend the Nuttall naming over the crap that has been invented for wikis. > >The Nuttall paper is available at many places such as: > >http://mwlab.pmo.ac.cn/~lzh/about_work/dspfftpaper/Some_Windows_with_Very_Good_Sidelobe_Behavior.pdf > >The original version of the paper is available from www.dtic.mil. Google on "ada085032". > >A description and evaluation of some of these and some other windows can be found at: > >http://compdsp.com/presentations/Dalrymple/dbd.pdf > >Dale B. Dalrymple
Excellent! Thanks much, Dale. I also ran across a couple National Instruments articles, if anyone else here is interested: http://zone.ni.com/reference/en-XX/help/371361H-01/lvanlsconcepts/char_smoothing_windows/ http://www.ni.com/white-paper/4844/en/
I think this section of wikipedia is interesting (as it tells when to use rectangular [flat-top] window):
https://en.wikipedia.org/wiki/Window_function#Applications_for_which_windows_should_not_be_used
> >The classic paper from Harris is available many places such as: > >http://utdallas.edu/~cpb021000/EE%204361/Great%20DSP%20Papers/Harris%20on%20Windows.pdf > >This IEEE Proceedings version has a number of numerical errors. A paper
by
>Nuttall gives some correction and additional windows with a sensible
naming
>convention. I recommend the Nuttall naming over the crap that has been >invented for wikis. > >The Nuttall paper is available at many places such as: > >http://mwlab.pmo.ac.cn/~lzh/about_work/dspfftpaper/Some_Windows_with_Very_Good_Sidelobe_Behavior.pdf > >The original version of the paper is available from www.dtic.mil. Google
on
>"ada085032". > >A description and evaluation of some of these and some other windows can
be
>found at: > >http://compdsp.com/presentations/Dalrymple/dbd.pdf > >Dale B. Dalrymple
If trying to extract specifications from a signal, a very good way to avoid annoying window tradeoffs is to use the method proposed by Boser here: http://www.researchgate.net/publication/3222829_Simulating_and_testing_oversampled_analog-to-digital_converters It applies to any signal, not just sigma-delta modulated, very interesting method/paper. The drawback is that you need to know the frequency of the signal of interest EXACTLY, which is very often times the case, at least for simulations. You basically use least-squares to reconstruct the desired signal (and desired harmonics) in the time domain, so you can then remove it from the signal prior to taking FFT and doing all sort of performance measurements. Windows can still be used, but one of the tradeoff is removed. --------------------------------------- Posted through http://www.DSPRelated.com
On 21.11.15 19.54, Max wrote:
> The window functions that I generally see are: Hamming, Hann (why call > it Hanning?), Blackman, and Blackman-Harris (feel free to add your > favorite here). Obviously they're all still around because they're > useful somewhere. But I'm curious about which is good for what > application.
The Wikipedia article about this topic is a quite good comparison of the most common window functions. https://en.wikipedia.org/wiki/Window_function Marcel
On Sunday, November 22, 2015 at 9:54:28 AM UTC-8, Marcel Mueller wrote:

> ... > The Wikipedia article about this topic is a quite good comparison of the > most common window functions. > > https://en.wikipedia.org/wiki/Window_function
Actually, the article provides very little on comparison of windows (one figure, 2 short paragraphs in a long article). The article consists of the common wiki regurgitation of not quite adequately digested source material. It does contain quite a few good references. I recommend reading the references. Don't be disturbed by the considerable differences between the content of the references and the content of the wiki article, particularly the portions of the wiki article that cite the references. Dale B. Dalrymple
dbd  <d.dalrymple@sbcglobal.net> wrote:

>On Sunday, November 22, 2015 at 9:54:28 AM UTC-8, Marcel Mueller wrote:
>> The Wikipedia article about this topic is a quite good comparison of the >> most common window functions. >> >> https://en.wikipedia.org/wiki/Window_function
>Actually, the article provides very little on comparison of windows (one >figure, 2 short paragraphs in a long article). The article consists of >the common wiki regurgitation of not quite adequately digested source >material. It does contain quite a few good references. I recommend >reading the references. Don't be disturbed by the considerable >differences between the content of the references and the content of the >wiki article, particularly the portions of the wiki article that cite >the references.
Dbd, it would be great if you listed your main objections on the "talk" page of the wiki article. Then I will might give a shot at editing it (I am not thus far a contributor to this particular article). Steve