Skip to content

7.8 DATA [TRUNCATION: WINDOW](#page-13-0) FUNCTIONS

← Back to LINEAR SYSTEMS AND SIGNALS Overview

7.8 DATA TRUNCATION: WINDOW FUNCTIONS

We often need to truncate data in diverse situations from numerical computations to filter design. For example, if we need to compute numerically the Fourier transform of some signal, say, eβˆ’t u(t), we will have to truncate the signal eβˆ’t u(t) beyond a sufficiently large value of t (typically five time constants and above). The reason is that in numerical computations, we have to deal with

Figure 7.45 Frequency-division multiplexing: (a) FDM spectrum (b) transmitter, and (c) receiver.

data of finite duration. Similarly, the impulse response h(t) of an ideal lowpass filter is noncausal and approaches zero asymptotically as |t|β†’βˆž. For a practical design, we may want to truncate h(t) beyond a sufficiently large value of |t| to make h(t) causal and of finite duration. In signal sampling, to eliminate aliasing, we must use an antialiasing filter to truncate the signal spectrum beyond the half-sampling frequency Ο‰s/2. Again, we may want to synthesize a periodic signal by adding the first n harmonics and truncating all the higher harmonics. These examples show that data truncation can occur in both time and frequency domains. On the surface, truncation appears to be a simple problem of cutting off the data at a point at which values are deemed to be sufficiently small. Unfortunately, this is not the case. Simple truncation can cause some unsuspected problems.

WINDOW FUNCTIONS

Truncation operation may be regarded as multiplying a signal of a large width by a window function of a smaller (finite) width. Simple truncation amounts to using a rectangular window wR(t) (shown later in Fig. 7.48a) in which we assign unit weight to all the data within the window width (|t| < T/2), and assign zero weight to all the data lying outside the window (|t| > T/2). It is also possible to use a window in which the weight assigned to the data within the window may not be constant. In a triangular window wT (t), for example, the weight assigned to data decreases linearly over the window width (shown later in Fig. 7.48b).

Consider a signal x(t) and a window function w(t). If x(t) ⇐⇒ X(Ο‰) and w(t) ⇐⇒ W(Ο‰), and if the windowed function xw(t) ⇐⇒ Xw(Ο‰), then

xw(t)=x(t)w(t)x_w(t) = x(t)w(t)

and Xw(Ο‰)=12Ο€X(Ο‰)βˆ—W(Ο‰)X_w(\omega) = \frac{1}{2\pi}X(\omega)*W(\omega)

According to the width property of convolution, it follows that the width of Xw(Ο‰) equals the sum of the widths of X(Ο‰) and W(Ο‰). Thus, truncation of a signal increases its bandwidth by the amount of bandwidth of w(t). Clearly, the truncation of a signal causes its spectrum to spread (or smear) by the amount of the bandwidth of w(t). Recall that the signal bandwidth is inversely proportional to the signal duration (width). Hence, the wider the window, the smaller its bandwidth, and the smaller the spectral spreading. This result is predictable because a wider window means that we are accepting more data (closer approximation), which should cause smaller distortion (smaller spectral spreading). Smaller window width (poorer approximation) causes more spectral spreading (more distortion). In addition, since W(Ο‰) is really not strictly bandlimited and its spectrum β†’ 0 only asymptotically, the spectrum of Xw(Ο‰) β†’ 0 asymptotically also at the same rate as that of W(Ο‰), even if X(Ο‰) is, in fact, strictly bandlimited. Thus, windowing causes the spectrum of X(Ο‰) to spread into the band where it is supposed to be zero. This effect is called leakage. The following example clarifies these twin effects of spectral spreading and leakage.

Let us consider x(t) = cos Ο‰0t and a rectangular window wR(t) = rect(t/T), illustrated in Fig. 7.46b. The reason for selecting a sinusoid for x(t) is that its spectrum consists of spectral lines of zero width (Fig. 7.46a). Hence, this choice will make the effect of spectral spreading and leakage easily discernible. The spectrum of the truncated signal xw(t) is the convolution of the two impulses of X(Ο‰) with the sinc spectrum of the window function. Because the convolution of any function with an impulse is the function itself (shifted at the location of the impulse), the resulting spectrum of the truncated signal is 1/2Ο€ times the two sinc pulses at Β±Ο‰0, as depicted in Fig. 7.46c (also see Fig. 7.26). Comparison of spectra X(Ο‰) and Xw(Ο‰) reveals the effects of truncation. These are:

  1. The spectral lines of X(Ο‰) have zero width. But the truncated signal is spread out by 2Ο€/T about each spectral line. The amount of spread is equal to the width of the mainlobe of the window spectrum. One effect of this spectral spreading (or smearing) is that if x(t) has two spectral components of frequencies differing by less than 4Ο€/T rad/s (2/T Hz), they

Figure 7.46 Windowing and its effects.

will be indistinguishable in the truncated signal. The result is loss of spectral resolution. We would like the spectral spreading [mainlobe width of W(Ο‰)] to be as small as possible.

  1. In addition to the mainlobe spreading, the truncated signal has sidelobes, which decay slowly with frequency. The spectrum of x(t) is zero everywhere except at Β±Ο‰0. On the other hand, the truncated signal spectrum Xw(Ο‰) is zero nowhere because of the sidelobes. These sidelobes decay asymptotically as 1/Ο‰. Thus, the truncation causes spectral leakage in the band where the spectrum of the signal x(t) is zero. The peak sidelobe magnitude is 0.217 times the mainlobe magnitude (13.3 dB below the peak mainlobe magnitude). Also, the sidelobes decay at a rate 1/Ο‰, which is βˆ’6 dB/octave (or βˆ’20 dB/decade). This is the sidelobe’s rolloff rate. We want smaller sidelobes with a faster rate of decay (high rolloff rate). Figure 7.46d, which plots |WR(Ο‰)| as a function of Ο‰, clearly shows the mainlobe and sidelobe features, with the first sidelobe amplitude βˆ’13.3 dB below the mainlobe amplitude and the sidelobes decaying at a rate of βˆ’6 dB/octave (or βˆ’20 dB/decade).

So far, we have discussed the effect on the signal spectrum of signal truncation (truncation in the time domain). Because of the time-frequency duality, the effect of spectral truncation (truncation in frequency domain) on the signal shape is similar.

REMEDIES FOR SIDE EFFECTS OF TRUNCATION

For better results, we must try to minimize the twin side effects of truncations: spectral spreading (mainlobe width) and leakage (sidelobe). Let us consider each of these ills.

    1. The spectral spread (mainlobe width) of the truncated signal is equal to the bandwidth of the window function w(t). We know that the signal bandwidth is inversely proportional to the signal width (duration). Hence, to reduce the spectral spread (mainlobe width), we need to increase the window width.
    1. To improve the leakage behavior, we must search for the cause of the slow decay of sidelobes. In Ch. 6, we saw that the Fourier spectrum decays as 1/Ο‰ for a signal with jump discontinuity, decays as 1/Ο‰2 for a continuous signal whose first derivative is discontinuous, and so on.† Smoothness of a signal is measured by the number of continuous derivatives it possesses. The smoother the signal, the faster the decay of its spectrum. Thus, we can achieve a given leakage behavior by selecting a suitably smooth (tapered) window.
    1. For a given window width, the remedies for the two effects are incompatible. If we try to improve one, the other deteriorates. For instance, among all the windows of a given width, the rectangular window has the smallest spectral spread (mainlobe width), but its sidelobes have high level and they decay slowly. A tapered (smooth) window of the same width has smaller and faster decaying sidelobes, but it has a wider mainlobe.‑ But we can compensate for the increased mainlobe width by widening the window. Thus, we can remedy both the side effects of truncation by selecting a suitably smooth window of sufficient width.

There are several well-known tapered-window functions, such as Bartlett (triangular), Hanning (von Hann), Hamming, Blackman, and Kaiser, which truncate the data gradually. These

† This result was demonstrated for periodic signals. However, it applies to aperiodic signals also. This is because we showed in the beginning of this chapter that if xT0 (t) is a periodic signal formed by periodic extension of an aperiodic signal x(t), then the spectrum of xT0 (t) is (1/T0 times) the samples of X(Ο‰). Thus,

what is true of the decay rate of the spectrum of xT0 (t) is also true of the rate of decay of X(Ο‰). ‑ A tapered window yields a higher mainlobe width because the effective width of a tapered window is smaller than that of the rectangular window; see Sec. 2.6-2 [Eq. (2.47)] for the definition of effective width. Therefore, from the reciprocity of the signal width and its bandwidth, it follows that the rectangular window mainlobe is narrower than a tapered window.

No.Window w(t)Mainlobe
Width
Rolloff
Rate
Level (dB)
Peak
Sidelobe
1t
Rectangular: rect
T
4Ο€
T
βˆ’6βˆ’13.3
2t
Bartlett:
2T
8Ο€
T
βˆ’12βˆ’26.5
32Ο€t
!
Hanning: 0.5
1+cos
T
8Ο€
T
βˆ’18βˆ’31.5
42Ο€t
Hamming: 0.54+0.46 cos
T
8Ο€
T
βˆ’6βˆ’42.7
52Ο€t
4Ο€t
Blackman: 0.42+0.5 cos
+0.08 cos
T
T
12Ο€
T
βˆ’18βˆ’58.1
6
2
t
I0
Ξ±
1βˆ’4
T
Kaiser:
0 ≀ Ξ± ≀ 10
I0(Ξ±)
11.2Ο€
T
βˆ’6βˆ’59.9
(Ξ± = 8.168)

TABLE 7.3 Some Window Functions and Their Characteristics

Figure 7.47 (a) Hanning and (b) Hamming windows.

windows offer different trade-offs with respect to spectral spread (mainlobe width), the peak sidelobe magnitude, and the leakage rolloff rate, as indicated in Table 7.3 [5, 6]. Observe that all windows are symmetrical about the origin (i.e., are even functions of t). Because of this feature, W(Ο‰) is a real function of Ο‰; that is, W(Ο‰) is either 0 or Ο€. Hence, the phase function of the truncated signal has a minimal amount of distortion.

Figure 7.47 shows two well-known tapered-window functions, the von Hann (or Hanning) window wHan(x) and the Hamming window wHam(x). We have intentionally used the independent variable x because windowing can be performed in the time domain as well as in the frequency domain, so x could be t or Ο‰, depending on the application.

There are hundreds of windows, all with different characteristics. But the choice depends on a particular application. The rectangular window has the narrowest mainlobe. The Bartlett (triangle) window (also called the Fejer or Cesaro) is inferior in all respects to the Hanning window. For this reason, it is rarely used in practice. Hanning is preferred over Hamming in spectral analysis because it has faster sidelobe decay. For filtering applications, on the other hand, the Hamming window is chosen because it has the smallest sidelobe magnitude for a given mainlobe width. The Hamming window is the most widely used general-purpose window. The Kaiser window, which uses I0(Ξ±), the modified zero-order Bessel function, is more versatile and adjustable. Selecting a proper value of Ξ± (0 ≀ Ξ± ≀ 10) allows the designer to tailor the window to suit a particular application. The parameter Ξ± controls the mainlobe-sidelobe trade-off. When Ξ± = 0, the Kaiser window is the rectangular window. For Ξ± = 5.4414, it is the Hamming window, and when Ξ± = 8.885, it is the Blackman window. As Ξ± increases, the mainlobe width increases and the sidelobe level decreases.

7.8-1 Using Windows in Filter Design

We shall design an ideal lowpass filter of bandwidth W rad/s, with frequency response H(Ο‰), as shown in Fig. 7.48e or Fig. 7.48f. For this filter, the impulse response h(t) = (W/Ο€ )sinc (Wt) (Fig. 7.48c) is noncausal and, therefore, unrealizable. Truncation of h(t) by a suitable window (Fig. 7.48a) makes it realizable, although the resulting filter is now an approximation to the desired ideal filter.† We shall use a rectangular window wR(t) and a triangular (Bartlett) window wT (t) to truncate h(t), and then examine the resulting filters. The truncated impulse responses hR(t) = h(t)wR(t) and hT (t) = h(t)wT (t) are depicted in Fig. 7.48d. Hence, the windowed filter frequency response is the convolution of H(Ο‰) with the Fourier transform of the window, as illustrated in Figs. 7.48e and 7.48f. We make the following observations.

    1. The windowed filter spectra show spectral spreading at the edges, and instead of a sudden switch there is a gradual transition from the passband to the stopband of the filter. The transition band is smaller (2Ο€/T rad/s) for the rectangular case than for the triangular case (4Ο€/T rad/s).
    1. Although H(Ο‰) is bandlimited, the windowed filters are not. But the stopband behavior of the triangular case is superior to that of the rectangular case. For the rectangular window, the leakage in the stopband decreases slowly (as 1/Ο‰) in comparison to that of the triangular window (as 1/Ο‰2). Moreover, the rectangular case has a higher peak sidelobe amplitude than that of the triangular window.