Evaluation of the Minimum Size of a Window for Harmonics Signals

Windowing applied to a given signal is a technique commonly used in signal processing in order to reduce spectral leakage in a signal with many data. Several windows are well known: hamming, hanning, beartlett, etc. The selection of a window is based on its spectral characteristics. Several papers that analyze the amplitude and width of the lobes that appear in the spectrum of various types of window have been published. This is very important because the lobes can hide information on the frequency components of the original signal, in particular when frequency components are very close to each other. In this paper it is shown that the size of the window can also have an impact in the spectral information. Until today, the size of a window has been chosen in a subjective way. As far as we know, there are no publications that show how to determine the minimum size of a window. In this work the frequency interval between two consecutive values of a Fourier Transform is considered. This interval determines if the sampling frequency and the number of samples are adequate to differentiate between two frequency components that are very close. From the analysis of this interval, a mathematical inequality is obtained, that determines in an objective way, the minimum size of a window. Two examples of the use of this criterion are presented. The results show that the hiding of information of a signal is due mainly to the wrong choice of the size of the window, but also to the relative amplitude of the frequency components and the type of window. Windowing is the main tool used in spectral analysis with nonparametric periodograms. Until now, optimization was based on the type of window. In this paper we show that the right choice of the size of a window assures on one hand that the number of data is enough to resolve the frequencies involved in the signal, and on the other, reduces the number of required data, and thus the processing time, when very long files are being analyzed.


Introduction
One of the most important tools in signal processing is the Nyquist theorem. Many of the processing tools are meaningless if the theorem is not satisfied. To date, the Nyquist theorem is often used in such a way that the acquisition of a signal is made with an excessive sampling frequency.
Sometimes, an overly large amount of samples is chosen. One of the most used tools to remedy the effect of oversampling is the use of windows that reduce noise and spectral leakage. Windows are used in non-parametric estimators and even in spectrograms.
In 1978 Fredric J. Harris published his article "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform" [1]. In this paper a comprehensive study of the properties and characteristics of the different types of windows in the time and frequency domains is conducted. The spectra of the windows are studied in detail, and an exhaustive analysis of the width of lateral and central lobes of a variety of windows is conducted. This analysis shows the effects or consequences of the lobes produced by the spectra of the windows. An example developed by Harris shows the hiding of information from a signal due to the lobes, and invites to select the type of window according to its spectral behavior. The results presented by Harris have not been questioned to date, and it is an important reference for many papers, including articles and books.
For over 30 years, research on the characteristics of the windows that appear in the article by Harris has not changed significantly. Many authors present new algorithms that allow for improvements in the lobes, both lateral and central, in the same direction as Harris [2]- [7].
As a complement to all previous work, the authors of this paper use the frequency resolution s f f N ∆ = (1) to determine the minimum number of samples required in a window.
Due importance has not been given to (1) even though it is fundamental in the analysis as well as in the acquisition of a signal. Without the adequate resolution, the frequency information, important to a particular phenomenon, might be hidden. The evaluation of the frequency resolution, before acquiring a signal or in the process of analyzing it, allows the making of decisions about the use of certain tools, such as the minimum size of a window.
The main contribution of this paper is the possibility of making a precise choice on the number of data that ensures the resolution between two very close frequencies, and diminishes the processing time by reducing the number of data required if the analysis is made before acquisition.

The Resolution ∆f
To date, little is known about what the minimum size of a window should be. Usually, the ad-hoc choice depends on the flair and experience of the user.
Harris mentions in his article: "The two operations to which we subject the data are sampling and windowing. These operations can be performed in either order. Sampling is well understood, windowing is less so, and sampled Windows for DFT's significantly less so!" [1]. In the same article he mentions "Windows are weighting functions applied to data to reduce the spectral leakage associated with finite observation intervals" [1].
Harris makes a detailed analysis of the time and frequency characteristics of the different types of windows. Currently the window type is selected according to its spectrum, but little is known of the minimum size of the window, so it continues to be evaluated subjectively.
Several processing tools like periodograms, spectrograms [8]- [11], are based on the use of windows. However, the main question of the minimum size of a window remains unanswered.
Examples with experimental and simulated signals, that show the importance of considering f ∆ , and for which it is possible to evaluate the minimum size of a window are In both Figure 1(a) and Figure 2(a), it is possible to notice changes in the amount of spectral leakage. However, the variation of the width of the peaks, which is only noticeable in a zoom-in, can be observed in Figure 1(b) and Figure 2(b). It is interesting to analyze the widest peaks in both figures. In Figure 1(b) the widest peak belongs to the spectral graph with the least number of samples, while the widest peak in Figure 2   Even though  Figure 4 shows the same experimental composite signal with four frequency components, acquired at two different sampling frequencies with the same number of samples used in Figure 3.   This work focuses on clarifying that the hiding of information in a signal depends, not only on the lobes of the spectra produced by the windows, but also on the fact that the frequency resolution f ∆ , is an important factor to consider when choosing the size of a window.

Minimum Size of a Window
To understand the importance of the frequency resolution f ∆ , we shall retake Figure   4, but this time showing the discrete intervals of f ∆ in the graphs, Figure 6.
An important feature to be noted in Figure 6 is the size of f ∆ in the different graphs. The dotted graph has smaller f ∆ than the one with the solid line. It is clear that large sampling frequencies do not imply small f ∆ .
In the analysis of different graphs, it was observed that the minimum size of a window was controlled by the size of f ∆ . In order to distinguish between two closely spaced components, it was necessary that, there is at least one f ∆ between them, i.e.: where 1 2 F yF are two closely spaced frequency components. With Equation (1) and Equation (2), the minimum number of a window samples, or the minimum size of a window can be determined in terms of where W N represents the number of samples of the window.
In the example we have 1 By applying this result the graphs shown in Figure 7 are obtained. For w N less than 1000 samples, it is impossible to observe all the components of the signal under study.
Inequality (3) allows the objective evaluation of the minimum size of a window. (3) provide the minimum size of a window very accurately when components we want to differentiate have very similar amplitudes.

Effect of Size vs Type
In this section the effect of the size of a window versus the use of the type of window is analyzed.
Different windows are used on a signal with two frequency components 1 Hz Hence 160 3 53 Figure 9 shows the graphs for a window with 64 samples. As can be seen in Figure 10, an increase on the size of the window provides better resolution and it is therefore possible to better distinguish the signal components involved.  In the following example a signal with two components, but with a difference in amplitude of 40 dBs is considered. Three types of windows are used in particular because they tend to hide information [1]. It will be shown that these windows hide information not only because of the lobes provided by their spectrum, but also because of the size of the window.  With the same sampling parameters, but slightly changing one of the frequencies (as in [1]); 1 10. Figure 13, is obtained.

Applications
The results shown so far allow for a more objective use of nonparametric periodograms. These are processing tools used to reduce significantly the signal leakage by applying spectral windowing, [9]- [12]. Using Equation (2) and Equation (3), Welch's parametric periodogram was applied to the compound signal with four frequency components that is analyzed in Figure 4 and Figure 5. Figure 18 shows the results. The Welch parametric periodogram was applied to the same signal considered in Figure 18. Figure 19 shows the periodogram using rectangular windows with 512 samples. Equation (2)      are as predicted by the theory, there is a decrease in the magnitude of the leakage-though with little significance for this example-when using an overlap of 75% in the rectangular windows employed.
Prabhu [12] suggests: "The resolution can be defined as the 3 dB bandwidth of the data window…". Resolution refers to the ability to discriminate spectral features, and is a key concept on the analysis of spectral estimator performance. In order to resolve two sinusoids that are relatively close together in frequency, it is necessary for the difference between the two frequencies to be greater than the width of the mainlobe of the leaked spectra for either one of these sinusoids. The mainlobe width is defined to be the width of the mainlobe at the point where the power is half the peak mainlobe power (i.e., the 3 dB width). This width is approximately equal to s f L . In other words, for two sinusoids of frequencies 1 f and 2 f , the resolvability condition requires that ( ) 1 2 Figure 21. Nonparametric Welch periodogram, window with 2048 samples, applied with different overlap percentages.
If the Matlab suggestion is applied to the example of two sinusoids separated by 10 KHz, the value obtained for L is ( ) MHz 500 10000 However, as Figure 19 shows, L = 512 cannot resolve the two nearby frequencies.

Conclusions
In this paper, an inequality is proposed to determine objectively the minimum size of a window, instead of the trial and error technique commonly used. The results can be applied in particular to certain spectral estimators, better known as nonparametric periodograms.
It is also shown that the minimum size of a window is required to observe all the frequency components of a given signal; it is necessary that the frequency resolution should be considered when a signal is acquired and not only the Nyquist theorem.
Once the minimum size of a window has been evaluated, the relative amplitude of the frequency components and window type would be factors to be considered depending on the leakage they produce.
This work leaves behind the subjectivity to determine the minimum size of a window, merely by considering the desired resolution, which is now possible to assess objectively by controlling the number of samples and the sampling frequency.
The resolution f ∆ is a parameter that, when considered before acquiring, optimizes the software or the hardware being used.
The consideration and evaluation of f ∆ will end to the ambiguity of ad-hoc "methods" employed in various signal processing tools to determine the minimum size of a given window, by using Equation (2) and Equation (3).
Harris [1] concludes "We have demonstrated the optimal windows (Kaiser-Bessel, Dolph-Chebyshev, and Barcilon-Temes) and the Blackman-Hams windows perform best in detection of nearby tones of significantly different amplitudes". This paper shows that, in addition to the type of window used, there are factors-as important as this one-that thwart the visualization of adjacent components, such as the difference in amplitude among components and the minimum size of a window.