# Window period(overlap) and FFT

How does changing the window period (i.e the number of points overlap between two frames) affect the FFT results ?

Suppose that a time series signal was converted to frequency domain by FFT with window size =2048 and window overlap=1024 and the output was plotted as a spectrum. Now will the appearance of the spectrogram change if the window overlap is reduced to 512 ?

In addition to what others have already said, I'll try to answer it from a purely practical point of view (this is also a variant of the overlap-add technique).

If your FFT length is 2048, then an overlap of 1024 (50%) means that you have twice as many analysis (FFT) frames (as compared to the number of frames without any overlapping). A 512 samples overlap (75%) means 4 times as many frames and so on.

The purpose of overlapping is primarily to reduce the effect of windowing. Most windowing functions (e.g Blackman, Hamming etc) are taper-shaped, which means that they drop to 0 (or close to 0) near the frame edges. This, of course, affects FFT results and we may lose some important information (e.g. transients).

So to reduce this negative effect of the windowing, we use overlapping. The basic idea here is that we can average FFT results form overlapping frames and thus obtain a better frequency representation of our time-domain signal. The actual frequency resolution is still the same as without overlapping.

As an example, let's say we use 1024 samples for the FFT and we have a 50% overlap (512 samples). We can average 3 overlapping frames to compute the final (averaged) magnitude values

M_avg[frame][i] = (M[frame-1][i]+M[frame][i]+M[frame+1]]i])/3 ; // i is just a bin index--in this case the bins range from 0 to 512


So, to compute the magnitudes for, say, frame #5, we average magnitudes from frames #4, #5# and #6 and divide by 3 (the number of averaged frames)

There are other use case for overlapping but the one described above is probably used the most.

• Although I like this answer I think you are supposed to average the square of the magnitudes rather than the magnitudes themselves holometer.fnal.gov/GH_FFT.pdf – Andy Piper Aug 21 '19 at 17:36
• @Andy Piper, I personally like to average raw fft results first and then compute the magnitudes from the averaged fft values (this, to me, looks more sound mathematically). I brought up magnitudes primarilly because the OP mentioned spectrograms and spectrograms are usually discussed in terms of magnitudes, rather than raw fft values. That said, square root operations are used to compute the magnitudes and once you've done that, you can pretty much do anything with them (depending on the actual application) – dsp_user Aug 22 '19 at 6:52

If you keep the sample rate and FFT size the same but change the overlap, then the number of FFTs per unit time will change. In a 2D spectrograph plot, a greater number of FFTs (or STFTs) per unit time will either roughly double the width of the plot, or shrink the X axis dimensioning, when plotting an equal duration.

It affects the results in the sense that you have to respect the constant overlap-add condition(COLA) in order for the sum of the successive FFTs computed during the STFT to correctly reconstruct the FFT of the whole signal.

This is the COLA condition:

$$\sum_{m=-\infty}^{\infty} w[n -mR] = 1 \quad\forall n \in \mathbb{Z}$$

where

• $w[n]$ is the window
• $R$ is the hop size in samples between consecutive windows

So if the window overlap that you choose does not respect the cola condition your STFT will not be able to correctly reconstruct the signal.