# Why use windowing function instead of truncating the signal to integer amount of periods?

According to this source of information if the signal is consisted of integer amount of periods then FFT would work ideally as if the signal was infinite in time. The same source mentions that windowing is not completely eliminating the spectrum leakage but just attenuating it. Therefore, my question is why perform windowing instead of truncating the signal to integer amount of periods, shouldn't the truncation to integer amount of periods give better results?

• So, can you truncate any signal so that all periods of all frequencies are integers?
– jojeck
Sep 5, 2017 at 7:59
• In addition to @jokek's comment: or always know beforehand which harmonics are present in your signal? Sep 6, 2017 at 15:00
• It makes sense. How about when we are certain that we are examining single frequency signal? Sep 7, 2017 at 10:25
• If you "know" that your signal contains a single harmonic, you know it's frequency and are able to capture an integer number of periods then using a window is not needed. Sep 7, 2017 at 14:10
• I meant "knowing" that the signal contains a single harmonic, without knowing the frequency. If you find 2 points with the same amplitude and same(similar) derivative, then the time distance between them should be the period.... Sep 8, 2017 at 11:19