The abrupt change of the starting value and ending value of the rectangular window function is the cause of its sidelobe. Therefore, the amplitude of sidelobe can be reduced by gently connecting the head and tail data of the input sequence, thus reducing the leakage of DFT.
Therefore, various window functions have been invented, and the commonly used window functions are: rectangular window function, Hanning, Hamming window function, blakeman and so on.
Extended data
When adding window function, the main lobe width of window function spectrum should be as narrow as possible to obtain high frequency resolution; Sidelobe attenuation should be as large as possible to reduce spectral tailing, but usually these two requirements cannot be met at the same time. The difference between various windows mainly lies in the ratio of energy concentrated in the main lobe to energy scattered in all sidelobes.
The choice of window depends on the target of analysis and the type of signal to be analyzed. Generally speaking, the wider the effective noise band, the worse the frequency resolution, and the more difficult it is to distinguish adjacent frequencies with the same amplitude.
The improvement of selectivity (that is, the ability to distinguish weak components near the frequency of strong components) is related to the attenuation rate of sidelobes. Usually, the sidelobe attenuation rate of the window with narrow effective noise bandwidth is low, so the choice of window is a compromise between the two.