windowing
Windowing means gently tapering a chunk of signal to zero at both ends before you analyze it, instead of chopping it off abruptly. Think of fading a song in and out rather than slamming the play button and yanking the power cord — the abrupt cut creates a jarring click, and in the frequency domain that 'click' is a smear of fake high frequencies. A window function (Hann, Hamming, Blackman, Kaiser…) multiplies the block by a smooth bell shape so the ends melt away.
The reason this matters is spectral leakage. The DFT pretends your block repeats forever; if the signal doesn't fit a whole number of cycles, the wrap-around discontinuity scatters energy into bins where it doesn't belong, burying weak nearby tones under the 'skirts' of strong ones. A good window trades a slightly wider main lobe for dramatically lower sidelobes — a Blackman window can push leakage down by 60–90 dB, the difference between seeing a faint signal and never knowing it was there.
There is no free lunch: every window widens the main lobe (coarser frequency resolution) in exchange for shorter sidelobes (less leakage). A boxcar (no window) has the sharpest resolution but worst leakage; the right choice depends on whether you must separate close tones or detect weak ones.