Fourier Series and Integrals Fourier Series
Total Page:16
File Type:pdf, Size:1020Kb
Fourier Series and Integrals Fourier Series Let f(x) be a piecewise linear function on [ L,L] (This means that f(x) may possess a finite number of finite discontinuities on the interval).− Then f(x) can be expanded in a Fourier series a ∞ nπx nπx f(x) = 0 + a cos + b sin , (1a) 2 n L n L n=1 X or, equivalently, ∞ inπx/L f(x) = cne (1b) X−∞ with (an ibn)/2 n < 0 c = (a +− ib )/2 n > 0 . n n n a0/2 n =0 A useful schematic form of the Fourier series is f~(x) = (ancˆn + bnsˆn). (2) n X This emphasizes that the Fourier series can be viewed as an expansion of a vector f~ in Hilbert space, in a basis that is spanned by thec ˆn (cosine waves of different periodicities) and thes ˆn (sine waves). nπx nπx To invert the Fourier expansion, multiply Eq. (1) by cos L or sin L and integrate over the interval. For this calculation, we need the basic orthogonality relation of the basis functions: L nπx mπx cos cos dx = δmnL, (3) L L L Z− and similarly for the sin’s. Intuitively, for n = m, there is destructive interference of the two factors in the integrand, while for n = m,6 there is constructive interference. nπx Thus by multiplying Eq. (1) by cos L and integrating, we obtain L L mπx a ∞ nπx nπx mπx f(x) cos dx = 0 + a cos + b cos dx, (4) L 2 n L n L L L L " 1 # Z− Z− X from which we find 1 L nπx an = f(x) cos dx. (5a) L L L Z− Similarly, the bn’s may be found to be 1 L nπx bn = f(x) sin dx. (5b) L L L Z− 1 The inversion of the Fourier series can be viewed as finding the projections of f~ along each basis direction. Schematically, therefore, the inversion can be represented as f~ cˆ = (a cˆ + b sˆ ) cˆ = a δ = a , (6a) · m n n n n · m n nm m n X X which implies a = f~ cˆ . (6b) m · n These steps parallel the calculation that led to Eq. (5). This schematic representation emphasizes that the Fourier decomposition of a function is completely analogous to the expansion of a vector in Hilbert space in an orthogonal basis. The components of the vector correspond to the various Fourier amplitudes defined in Eqs. (5a) and (5b). Examples: 1. Square Wave f(x) h x -2L-L 0 L 2L 3L Clearly f(x) is an odd function: f(x) = f( x). Hence − − 1 L nπx an = f(x) cos dx =0 n L L L ∀ Z− As a result, the spectral information of the square wave is entirely contained in the bn’s. These coefficients are 1 L nπx 2h L nπx 2h bn = f(x) sin dx = sin dx = (1 cos nπ), L L L L 0 L nπ − Z− Z from which we find b = 4h/nπ n odd . n 0 n even n Thus the square wave can be written as a Fourier sine series 4h πx 1 3πx 1 5πx f(x) = sin + sin + sin + . (7) π L 3 L 5 L ··· There are a number of important general facts about this expansion that are worth em- phasizing: Since f(x) is odd, only odd powers of the antisymmetric basis functions appear. • 2 At the discontinuities of f(x), the Fourier series converges to the mean of the two • values of f(x) on either side of the discontinuity. A picture of first few terms of the series demonstrates the nature of the convergence • to the square wave; each successive term in the series attempts to correct for the “overshoot” present in the sum of all the previous terms one term two terms three terms ten terms The amplitude spectrum decays as 1/n; this indicates that a square wave can be • well-represented by the fundamental frequency plus the first few harmonics. By examining the series for particular values of x, useful summation formulae may • sometimes be found. For example, setting x = L/2 in the Fourier sine series gives 4h π 1 3π 1 5π f(x = L/2) = h = sin + sin + sin + π 2 3 2 5 2 ··· and this leads to a nice (but slowly converging) series representation for π/4: π = (1 1/3+1/5 1/7+1/9 ). 4 − − ··· Alternatively we may represent the square wave as an even function. 3 f(x) h x -2L-L 0 L 2L 3L Now f(x) = +f( x). By symmetry, then, bn =0 n, and only the an’s are non-zero. For these coefficients− we find ∀ 1 L nπx 2 L nπx an = f(x) cos = f(x) cos L L L L 0 L Z− Z 2h L/2 nπx L nπx = cos dx cos dx L L − L "Z0 ZL/2 # 2h nπ/2 nπ = cost dt cost dt nπ − "Z0 Znπ/2 # 2h = sint nπ/2 sint nπ nπ |0 − |nπ/2 4hh (n 1)/2 i = nπ ( 1) − n odd . 0 − n even Hence f(x) can be also represented as the Fourier cosine series 4h πx 1 3πx 1 5πx f(x) = cos cos + cos . (8) π L − 3 L 5 L ··· This example illustrates the use of symmetry in determining a Fourier series, even function cosine series −→ odd function sine series −→ no symmetry both sine and cosine series −→ Thus it is always simpler to choose an origin so that f(x) has a definite symmetry, so that it can be represented by either a sin or cosine series 2. Repeated Parabola This is the periodic extension of the function x2, in the range [ π,π], to the entire real line. Given any function defined on the interval [a,b], the periodic extension− may be constructed in a similar fashion. In general, we can Fourier expand any function on a finite range; the Fourier series will converge to the periodic extension of the function. 4 −3π −π π 3π The Fourier expansion of the repeated parabola gives b =0 n n ∀ π 2 1 2 2π a0 = x dx = π π 3 Z− 2 π 4 a = x2 cos nx dx =( 1)n n π − n2 Z0 Thus we can represent the repeated parabola as a Fourier cosine series π2 ∞ ( 1)n f(x) = x2 = +4 − cos nx. (9) 3 n2 n=1 X Notice several interesting facts: The a0 term represents the average value of the function. For this example, this • average is non-zero. Since f is even, the Fourier series has only cosine terms. • There are no discontinuities in f, but first derivative is discontinuous; this implies that • the amplitude spectrum decays as 1/n2. In general, the “smoother” the function, the faster the decay of the amplitude spectrum as a function of n. Consequently, progressively fewer terms in the Fourier series are needed to represent the waveform to a fixed degree of accuracy. Setting x = π in the series gives • π2 ∞ ( 1)n π2 = +4 − cos nπ 3 n2 n=1 X from which we find π2 ∞ 1 = 6 n2 n=1 X This provides an indirect, but simple, way to sum inverse powers of the integers. One simply Fourier expands the function xk on the interval [ π,π] and then evaluates the k − z series at x = π from which n∞=1 n− can be computed. The sum n∞=1 n− ζ(z), is called the Riemann zeta function, and by this Fourier series trick the zeta function≡ can be evaluated for all positiveP integer values of z. P 5 In summary, a Fourier series represents a spectral decomposition of a periodic waveform into a series of harmonics of various frequencies. From the relative amplitudes of these harmonics we can gain understanding of the physical process underlying the waveform. For example, one perceives in an obvious way the different tonal quality of an oboe and a violin. The origin of this difference are the very different Fourier spectra of these two instruments. Even if the same note is being played, the different “shapes” of the two instruments (string for the violin; air column for the oboe) imply very different contributions of higher harmonics. This translates into very different respective Fourier spectra, and hence, very different musical tones. Fourier Integrals For non-periodic functions, we generalize the Fourier series to functions defined on [ L,L] with L . To accomplish this, we take Eq. (5), − →∞ 1 L nπx an = f(x) cos dk L L L Z− and now let k = nπ/L ndk. Then as L , we obtain ≡ →∞ ∞ A(k) a L = f(x) cos kxdx (10a) ≡ n Z−∞ and, by following the same procedure, ∞ B(k) b L = f(x) sin kxdx (10b) ≡ n Z−∞ Now the original Fourier series becomes nπx nπx f(x) = a cos + b sin n L n L n X (11a) A(k) B(k) 1 ∞ = cos kx + sin kx A(k) cos kxdk + B(k) sin kxdk. L L → π n k=0 X Z By using the exponential form of the Fourier series, we have the alternative, but more familiar and convenient Fourier integral representation of f(x), 1 ∞ f(x) = f(k)eikx dk. (11b) √2π Z−∞ Where the (arbitrary) prefactor is chosen to be 1/√2π for convenience, as the same pref- actor appears in the definition of the inverse Fourier transform. In symbolic form, the Fourier integral can be represented as f~ = fkeˆk.