What's the purpose of window function in spectral analysis? I'd like to see the answer with qualitative view on the problem, not just definition. Examples and analogous from other areas of applied math also would be good.
I understand, my question is silly, but I can't find good and intuitive introduction textbook on signal processing — if someone would suggest one, I will be happy.
 A: It depends on where you apply the window function.  If you do it in the time domain, it's because you only want to analyze the periodic behavior of the function in a short duration.  You do this when you don't believe that your data is from a stationary process.  
If you do it in the frequency domain, then you do it to isolate a specific set of frequencies for further analysis; you do this when you believe that (for instance) high-frequency components are spurious.
The first three chapters of "A Wavelet Tour of Signal Processing" by Stephane Mallat have an excellent introduction to signal processing in general, and chapter 4 goes into a very good discussion of windowing and time-frequency representations in both continuous and discrete time, along with a few worked-out examples.
A: The main aim of windowing in spectral analysis is the ability of zooming into the finer details of the signal rather than looking the whole signal as such. Short Time Fourier Transforms(STFT) are of prime importance in case of speech signal processing where the information like pitch or the formant frequencies are extracted by analyzing the signals through a window of specific duration. The width of the windowing function relates to how the signal is represented that is it determines whether there is good frequency resolution (frequency components close together can be separated) or good time resolution (the time at which frequencies change).A wide window gives better frequency resolution but poor time resolution. A narrower window gives good time resolution but poor frequency resolution. These are called narrowband and wideband transforms, respectively. This is the exact reason as why a wavelet transform was developed where a wavelet transform is capable of giving good time resolution for high frequency events and good frequency resolution for low frequency events. This type of analysis is well suited for real signals.
