# Choosing the right overlap for a window function

On Wikipedia there is quite a list of window functions. However, when you are doing a lot of STFTs, you often have to have some overlap to get better results.

Generally an overlap factor of 2 (i.e., 50% overlap) works fine (I'm doing analysis & resynthesis), but for some windows it isn't good (I currently have this experience with the Blackman window).

I tried my best but I couldn't find a resource that would list the "good" overlap factors for common and less common windows.

• I'm pretty sure more overlap is always better. The trade-off is only with the amount of time it will take to compute. Commented Dec 30, 2013 at 16:06
• Jim, one reason the Blackman doesn't work so good for <b>resynthesis</b> is that it is not complementary. to get perfect reconstruction with the STFT, you need all of the windows, with their various offsets, to add up to a constant (which can be scaled to one). Commented Dec 30, 2013 at 18:27
• @Aaron More overlap is not necessarily always better. If you overlap too much, your frames are going to become heavily correlated and their usage (in averaging) diminishes. Commented Dec 30, 2013 at 23:00
• @JimClay The tradeoff in overlap amount has to do with minimizing the correlation between frames (lesser overlap) while simultaneously maximizing the degree by which all samples see the same weighting during the overlap process. (more overlap). This optimization problem is seeded with the window itself, and the final result thus depends on the shape of any particular window. For blackman windows the optimal result turns out to be ~67% as a generalization of Kaiser-$\alpha$-4 type windows. Commented Dec 30, 2013 at 23:09
• @robertbristow-johnson Yes, increasing overlap, you will have more correlated frames. If you average heavily correlated data, how can you get averaging gain out of it? Example: Take 10 snapshots of DC + noise, where the noise in each snapshot is uncorrelated, and average them. Similarly, take 10 snapshots of DC + noise, where all the 10 frames are 99% correlated. Which one gives you better noise reduction via averaging? (PS you need to do '@user4619' and then the number for it to ping me, not just my number). Cheers. Commented Dec 31, 2013 at 12:41

Please refer to this paper on the optimum overlap percentage for the Blackman-Harris window, which is derived to be 66.1%. It has a lot of useful information on spectral analysis and windows.

• wow, thank you very much, what I was looking for was on page 29 on this very well-written paper! Commented Dec 31, 2013 at 9:37
• I wish we could sticky this paper somewhere. A lot of questions regarding spectral analysis and windows could be answered just by reading this paper. Commented Dec 31, 2013 at 14:11
• be nice for those of us outside of academia to get a copy we don't have to pay  for. Commented Dec 31, 2013 at 15:45
• The paper is publicly available, there's a link at the bottom for the pdf. Commented Dec 31, 2013 at 15:56
• can you provide more summary? answers should contain more than just links Commented Sep 12, 2014 at 19:37

I tried my best but I couldn't find a resource that would list the "good" overlap factors for common and less common windows.

Here's a list of window functions and overlap factors that have constant overlap-add (COLA). (Code here)

Heinzel - Spectrum and spectral density estimation... shows several windows and lists their "optimum overlap" and their "amplitude flatness" (AF graph) for different amounts of overlap. The overlap-add is flat when the AF graph is 1.0, so for Hann, for instance, it's COLA at 50%, 66.66%, 75%, etc.:

Their "optimum" overlap is the best trade-off between amplitude flatness and wasted computation time (not necessarily COLA). (The Hamming window's AF curve looks like it doesn't reach 1.0, but it actually does at tiny points if you zoom in.)

Note that I've listed these as fractions of overlap, not percent, since that's more natural. The COLA overlap that has the best trade-off is shown in bold.

• Rectangular
• SciPy: boxcar()
• MATLAB: rectwin()
• Optimum: 0%
• COLA: 0, 1/2, 2/3, 3/4, 4/5, 5/6, 6/7, ...
• Bartlett-Hann:
• SciPy barthann()
• MATLAB: barthannwin()
• COLA: 1/2, 3/4, 5/6, 7/8, 9/10, 11/12, 13/14, ...
• Bartlett:
• SciPy/MATLAB: bartlett()
• Optimum: 50%
• COLA: 1/2, 3/4, 5/6, 7/8, 9/10, 11/12, 13/14, ...
• MATLAB's triang
• SciPy/MATLAB: triang()
• COLA: 1/2, 3/4, 5/6, 7/8, 9/10, 11/12, ...
• Blackman 3-term
• SciPy/MATLAB: blackman()
• COLA: 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, ...
• Blackman-Harris minimum 4-term
• SciPy/MATLAB: blackmanharris()
• Optimum: 66.1%
• COLA: 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, ...
• Flat-top 5th-order D'Antona:
• SciPy: flattop()
• MATLAB: flattopwin()
• COLA: 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, ...
• Hamming
• SciPy/MATLAB: hamming()
• Optimum: 50%
• COLA: 1/2, 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, ...
• Hann
• SciPy/MATLAB: hann()
• Optimum: 50%
• COLA: 1/2, 2/3, 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, ...
• Nuttall4c
• SciPy: nuttall()
• MATLAB: nuttallwin()
• Optimum: 65.6%
• COLA: 3/4, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, ...
• Parzen
• SciPy: parzen()
• MATLAB: parzenwin()
• COLA: 3/4, 7/8, 11/12, 15/16, 19/20, 23/24, ...
• Tukey
• SciPy: tukey(alpha=0.5)
• MATLAB: tukeywin(r=0.5)
• COLA: 3/4, 5/6, 7/8, 9/10, 11/12, 13/14, ...
• Welch:
• Optimum: 29.3%
• COLA: None?

Also, Borβ-Martin points out that you can generate a COLA window for any arbitrary overlap by convolving an overlap-length window of area 1 with a hop-length rectangular window. They provide a particular family of windows that let you trade off main lobe width and sidelobe fall-off rate.

The area under the curve of a Blackman window is less than 50% that of a rectangular window (for a von Hann window the percentage is exactly 50%). So more information will be lost (to quantization or other noise) by the windowing process using a Blackman window than using a von Hann window (or using a rectangular window for that matter). Using overlapping windows provides some information redundancy (the same samples will be processed multiple times into the results), so more overlap can make up for some of this loss of information.

Using more overlap provides more time locality resolution as well as more informational redundancy. However, since time resolution is also affected (blurred) by the effective window width, there will diminishing returns in using too much overlap (e.g. stop increasing overlap when your analysis process no longer sees "useful" differences between offset frames).

50% overlapped von Hann windows also "add up" to a flat top window, which is useful for resynthesis without amplitude modulation distortion, no matter if a different window is used for analysis.

Maybe look for the keywords ,,shift overlap add property'' or ,,constant overlap add property'' - Some window functions have the advantage to sum up to a constant function if taken in the proper distance, as was remarked here.