Thompson - Computing for Scientists and Engineers (523188), страница 63
Текст из файла (страница 63)
A clue to therapid convergence of this Fourier series is the appearance of reciprocal squares of kin the wedge-function Fourier amplitudes rather than just the reciprocal of k, as occurs in (9.52) for the square pulse. This comparison leads to a relation between thewedge and square functions, namely that times the derivative of the wedge function just produces the square-pulse function, as you may easily verify by comparison of Figures 9.9 and 9.11.Exercise 9.20(a) Prove the derivative relation just stated for the relation between wedge andsquare functions.(b) Use this relation to obtain the square-pulse Fourier expansion (9.54) by differentiation of the wedge function Fourier expansion (9.60).
nThus we realize that various Fourier expansions may be interrelated through termby-term comparison of their series. This is both a practical method of generatingFourier series and a good way to check the correctness of expansions derived byother means. Similar connections appear for the window and sawtooth functionswhich we now consider.The window functionA window, which allows a signal in a certain range of x, but blocks out the signaloutside this range, is a very important function in image and signal processing. Forexample, if x denotes spatial position and y is the intensity level of an object, thenwe have literally an optical window. If x = t, the time, and y = V, the voltageacross a circuit element, the window allows the voltage signal through only for afinite time.
We consider only a very simple window; more general classes of window functions are considered in the books by Oppenheim and Schafer, and by Pratt.The window function is also called the “boxcar” function, from its resemblance tothe silhouette of a railroad boxcar.In our example of the window function we have the somewhat artificial (but algebraically convenient) window of width centered on x =For a window ofdifferent width or height, one may use the interval scaling in (9.48) and (9.49).Magnitude scaling is done by direct multiplication of each coefficient by the appropriate scale factor because Fourier expansions are linear expansions. Our windowfunction is(9.61)346DISCRETE FOURIER TRANSFORMS AND FOURIER SERIESThe quickest way to get the Fourier series coefficients for the window functionis to relate it to the square pulse (9.50), by evaluating the latter at x dividingit by 2, then adding 1/2.
We obtain immediately(9.62)(9.63)This is the first of our examples in which the coefficients alternate in sign.Exercise 9.21Use the integral formulas (9.44) and (9.45) directly to verify the above resultsfor the Fourier coefficients of the window function. nThe window function in k space is shown in Figure 9.12.
Because of its simple relation to the square pulse, the magnitudes of these coefficients have the same dependence on k (except for the first) as do the square-wave coefficients in Figure 9.8.The approximate reconstruction of the window function is very similar to that ofthe square pulse in (9.54). By using (9.62) and (9.63) for the Fourier amplitudes,we have immediately that(9.64)where (with M assumed to be odd)(9.65)FIGURE 9.12 Fourier series coefficients, ak, for the window function (9.61).9.5SOME PRACTICAL FOURIER SERIES347FIGURE 9.13 Fourier series reconstruction of the window function (9.61) up to the Mth harmonic for M = 3 (dotted) and for M = 31 (dashed).Expression (9.65) has a similar dependence on M to that of the square pulseshown in Figure 9.9.
The window is displayed in Figure 9.13 for the same Mvalues as used for the square pulse. By running program Fourier Series withchoice = 3, you can discover how the convergence of the series depends on theharmonic number M.The sawtooth functionOur last example of a Fourier series is that of the sawtooth function(9.66)Such a function is used, for example, in electronics to provide a voltage sweep and aflyback (raster) in video imaging. Here y would be voltage and x time. In such applications, the number of harmonics needed to give an accurate approximation to thesudden drop in y which occurs at x = is important.The Fourier coefficients may be found either by direct integration using (9.44)and (9.45) or by using the proportionality of the derivative of the sawtooth to thesquare pulse, namely(9.67)Therefore, by integrating the square pulse with respect to x, dividing by then including the appropriate constant of integration, you can find the sawtooth Fourierseries.
It is given by348DISCRETE FOURIER TRANSFORMS AND FOURIER SERIES(9.68)The Fourier amplitudes of the sawtooth can therefore be read off by inspection:namely:(9.69)(9.70)Exercise 9.22(a) Make the indicated integration of (9.67), then find the constant of integration(for example by insisting that y = 0 at x = 0), to derive the sawtooth Fourierseries (9.68).(b) Verify the Fourier amplitude formulas by substituting the sawtooth function(9.68) directly into the integral fonnulas (9.44) and (9.45). nThe sawtooth function in k space has the representation shown in Figure 9.14.The envelope of the amplitudes is a rectangular hyperbola, Convergence of thesawtooth series will be fairly slow compared with that for the wedge function investigated above. This is illustrated in Figure 9.15 for M = 2 and M = 20.
Note forthe latter the strong oscillations (“ringing”) near the flyback at x = This is characteristic of functions that have a sudden change of value, as seen for the squarepulse above and discussed more completely in Section 9.6 as the Wilbraham-Gibbsphenomenon.FIGURE 9.14 Fourier series coefficients for the sawtooth function (9.66) as a function of harmonic number k.9.6 DIVERSION: THE WILBRAHAM-GIBBS OVERSHOOT349FIGURE 9.15 Approximation of the sawtooth function (9.66) by the first two harmonics(dotted curve) and by the first twenty harmonics (dashed line).Exercise 9.23Investigate the convergence of the Fourier series for the sawtooth, (9.66), byrunning Fourier Series for a range of values of M and with choice = 4in order to select the sawtooth. Comment both on the convergence as a functionof M and on the ringing that occurs near the discontinuity at x = nThe sawtooth example concludes our discussion of detailed properties of someFourier series.
In the next section we explore two important general properties ofFourier series that limit the accuracy of such expansions.9.6 DIVERSION: THE WILBRAHAM-GIBBS OVERSHOOTWe noticed in the preceding section, particularly for the square pulse and the sawtooth, that near the discontinuity there seems to be a persistent oscillation of theFourier series approximation about the function that it is describing. This is the socalled “Gibbs phenomenon,” the persistent discrepancy, or “overshoot,” between adiscontinuous function and its approximation by a Fourier series as the number ofterms in the series becomes indefinitely large. What aspect of this pulse gives rise tothe phenomenon, and does it depend upon the function investigated?Historically, the explanation of this phenomenon is usually attributed to one ofthe first American theoretical physicists, J.
Willard Gibbs, in the two notes published in 1898 and 1899 that are cited in the references. Gibbs was motivated to makean excursion into the theory of Fourier series because of an observation of AlbertMichelson that his harmonic analyzer (one of the first mechanical analog computers)produced persistent oscillations near discontinuities of functions that it Fourier350DISCRETE FOURIER TRANSFORMS AND FOURIER SERIESanalyzed, even up to the maximum harmonic (M = 8O) the machine could handle.The phenomenon had, however, already been observed numerically and explainedfairly completely by the English mathematician Henry Wilbraham 50 years earlier incorrecting a remark by Fourier on the convergence of Fourier series.
It is thereforemore appropriate to call the effect the “Wilbraham-Gibbs phenomenon” than the“Gibbs phenomenon,” so that is the name used here.The first extensive generalization of the phenomenon, including the conditionsfor its existence, was provided by the mathematician Bôcher in 1906 in a treatise.Both this treatment and those in subsequent mathematical treatises on Fourier seriesare at an advanced level. A readable discussion is, however, provided in Körner’sbook.
Here we investigate by a rigorous method the problem of Fourier series forfunctions with discontinuities; we present the essence of the mathematical treatmentswithout their complexity; and we discuss how to estimate the overshoot numerically.I have given a similar treatment elsewhere (Thompson 1992).We first generalize the sawtooth function to include in a single formula the conventional sawtooth, the square-pulse, and the wedge functions, already consideredin Section 9.5.
Their Fourier amplitudes can be calculated as special cases of theFourier series formula that we derive to provide the starting point for understandingthe Wilbraham-Gibbs phenomenon. Finally, we give some detail on numericalmethods for estimating the overshoot values so that you can readily make calculations yourself.Fourier series for the generalized sawtoothThe generalized sawtooth function that we introduce is sketched in Figure 9.16 (a).It is defined by(9.71)in terms of the slopes on the left- and right-hand sides of the discontinuity, sL andsR, and the extent of the discontinuity, D. From this definition we can obtain all thefunctions investigated in Section 9.5; the square pulse, for which sL = sR = 0,D = 2 ; the wedgeand the sawtoothD = 2).For our purposes the Fourier amplitudes, ak and bk, can most conveniently beobtained from the complex-exponential form (9.42), so that(9.72)Recall that, according to Section 6.2, the Fourier amplitudes, for given M, providethe best fit in the least-squares sense of an expansion of the function y in terms ofcosines and sines.
Therefore, attempts to smooth out the Wilbraham-Gibbs phenomenon by applying damping factors necessarily worsen the overall fit.9.6DIVERSION: THE WILBRAHAM-GIBBS OVERSHOOT351FIGURE 9.16 Generalized sawtooth function for discussing the Wilbraham and Gibbs phenomenon. The solid lines in part (a) show the function and in part (b) they show its derivative withrespect to x.We note immediately, and most importantly for later developments, that a discontinuity in any derivative of a function is no stumbling block to calculating itsFourier series.