where is the window length in samples (assumed odd for now). A plot of the rectangular window appears in Fig.3.1 for length . It is sometimes convenient to define windows so that their dc gain is 1, in which case we would multiply the definition above by . frequency domain, we need to look at the DTFT of the window:
We can factor out linear phase terms from the numerator and denominator of the above expression to get
where denotes the aliased sinc function:4.1
(also called the Dirichlet function [175,72] or periodic sinc function). This (real) result is for the zero-centered rectangular window. For the causal case, a linear phase term appears:
The term ``aliased sinc function'' refers to the fact that it may be simply obtained by sampling the length- continuous-time rectangular window, which has Fourier transform sinc (given amplitude in the time domain). Sampling at intervals of seconds in the time domain corresponds to aliasing in the frequency domain over the interval Hz, and by direct derivation, we have found the result. It is interesting to consider what happens as the window duration increases continuously in the time domain: the magnitude spectrum can only change in discrete jumps as new samples are included, even though it is continuously parametrized in . As the sampling rate goes to infinity, the aliased sinc function therefore approaches the sinc function
where .4.2 3.2 illustrates for . Note that this is the complete window transform, not just its real part. We obtain real window transforms like this only for zero-centered, symmetric windows. Note that the phase of rectangular-window transform is zero for , which is the width of the main lobe. This is why zero-centered windows are often called zero-phase windows; while the phase actually alternates between 0 and radians, the values occur only within side-lobes which are routinely neglected (in fact, the window is normally designed to ensure that all side-lobes can be neglected). More generally, we may plot both the magnitude and phase of the window versus frequency, as shown in Figures 3.4 and 3.5 below. In audio work, we more typically plot the window transform magnitude on a decibel (dB) scale, as shown in Fig.3.3 below. It is common to normalize the peak of the dB magnitude to 0 dB, as we have done here. 3.3 and Eq. (3.4), we see that the main-lobe width is radian, and the side-lobe level is 13 dB down. Since the DTFT of the rectangular window approximates the sinc function (see (3.4)), which has an amplitude envelope proportional to (see (3.7)), it should ``roll off'' at approximately 6 dB per octave (since ). This is verified in the log-log plot of Fig.3.6.
Its main-lobe width is and its first side-lobe is 13 dB down from the main-lobe peak. As gets bigger, the main-lobe narrows, giving better frequency resolution (as discussed in the next section). Note that the window-length has no effect on side-lobe level (ignoring aliasing). The side-lobe height is instead a result of the abruptness of the window's transition from 1 to 0 in the time domain. This is the same thing as the so-called Gibbs phenomenon seen in truncated Fourier series expansions of periodic waveforms. The abruptness of the window discontinuity in the time domain is also what determines the side-lobe roll-off rate (approximately 6 dB per octave). The relation of roll-off rate to the smoothness of the window at its endpoints is discussed in §B.18.
5 (§3.1). Here we summarize the results of that discussion. Definition ( odd):
The DTFT of a rectangular window is shown in Fig.3.7.
- Zero crossings at integer multiples of
- Main lobe width is .
- As increases, the main lobe narrows (better frequency resolution).
- has no effect on the height of the side lobes (same as the ``Gibbs phenomenon'' for truncated Fourier series expansions).
- First side lobe only 13 dB down from the main-lobe peak.
- Side lobes roll off at approximately 6dB per octave.
- A phase term arises when we shift the window to make it causal, while the window transform is real in the zero-phase case (i.e., centered about time 0).
Generalized Hamming Window Family