# 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? – jojek Sep 5 '17 at 7:59
• In addition to @jokek's comment: or always know beforehand which harmonics are present in your signal? – user883521 Sep 6 '17 at 15:00
• It makes sense. How about when we are certain that we are examining single frequency signal? – Phill Donn Sep 7 '17 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. – user883521 Sep 7 '17 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.... – Phill Donn Sep 8 '17 at 11:19