C H A P T E R 12 Fourier Series I n 1807, the French mathematician and physicist Joseph Fourier submitted a paper on heat conduction to the Academy of Sciences of Paris. In this paper Fourier made the claim that any function f .x / can be expanded into an infinite sum of trigonometric functions, f .x / D a0 2 C 1 X k D1 Tak cos.kx / C bk sin.kx /U; for x : The paper was rejected after it was read by some of the leading mathematicians of his day. They objected to the fact that Fourier had not presented much in the way of proof for this statement, and most of them did not believe it. In spite of its less than glorious start, Fourier’s paper was the impetus for major developments in mathematics and in the application of mathematics. His ideas forced mathematicians to come to grips with the definition of a function. This, together with other metamathematical questions, caused nineteenth-century mathematicians to rethink completely the foundations of their subject, and to put it on a more rigorous foundation. Fourier’s ideas gave rise to a new part of mathematics, called harmonic analysis or Fourier analysis. This, in turn, fostered the introduction at the end of the nineteenth century of a completely new theory of integration, now called the Lebesgue integral. The applications of Fourier analysis outside of mathematics continue to multiply. One important application pertains to signal analysis. Here, f .x / could represent the amplitude of a sound wave, such as a musical note, or an electrical signal from a CD player or some other device (in this case x represents time and is usually replaced by t). The Fourier series representation of a signal represents a decomposition of this signal into its various frequency components. The terms sin kx and cos kx 712 12.1 Computation of Fourier Series 713 oscillate with numerical frequency1 of k =2 . Signals are often corrupted by noise, which usually involves the high-frequency components (when k is large). Noise can sometimes be filtered out by setting the high-frequency coefficients (the ak and bk when k is large) equal to zero. Data compression is another increasingly important problem. One way to accomplish data compression uses Fourier series. Here the goal is to be able to store or transmit the essential parts of a signal using as few bits of information as possible. The Fourier series approach to the problem is to store (or transmit) only those ak and bk that are larger than some specified tolerance and discard the rest. Fortunately, an important theorem (the Riemann–Lebesgue Lemma, which is our Theorem 2.10) assures us that only a small number of Fourier coefficients are significant, and therefore the aforementioned approach can lead to significant data compression. 12.1 Computation of Fourier Series The problem that we wish to address is the one faced by Fourier. Suppose that f .x / is a given function on the interval T ; U. Can we find coefficients, an and bn , so that 1 a0 X f .x / D C [an cos nx C bn sin nx] ; for x ? (1.1) 2 n D1 Notice that, except for the term a0 =2, the series is an infinite linear combination of the basic terms sin nx and cos nx for n a positive integer. These functions are periodic with period 2= n, so their graphs trace through n periods over the interval T ; U. Figure 1 shows the graphs of cos x and cos 5x, and Figure 2 shows the graphs of sin x and sin 5x. Notice how the functions become more oscillatory as n increases. 1 −π 1 π −1 Figure 1 The graphs of cos x and cos 5x. x −π π x −1 Figure 2 The graphs of sin x and sin 5x. The orthogonality relations Our task of finding the coefficients an and bn for which (1.1) is true is facilitated by the following lemma. These orthogonality relations are one of the keys to the whole theory of Fourier series. 1 Be sure you know the difference between angular frequency, k in this case, and numerical frequency. It is explained in Section 4.1. 714 Chapter 12 Fourier Series LEMMA 1.2 Let p and q be positive integers. Then we have the following orthogonality relations. Z sin px cos qx d x Z sin px d x Z cos px cos qx d x Z sin px sin qx d x D Z cos px d x D0 (1.3) D0 D D (1.4) ( ; if p D q 0; if p 6 D q (1.5) 6D q (1.6) ( ; if p D q 0; if p We will leave the proof of these identities for the exercises. Computation of the coefficients The orthogonality relations enable us to find the coefficients an and bn in (1.1). Suppose we are given a function f that can be expressed as f .x / D a0 2 C 1 X k D1 Tak cos kx C bk sin kx U (1.7) on the interval T ; U. To find a0 , we simply integrate the series (1.7) term by term. Using the orthogonality relation (1.3), we see that Z f .x / d x D a0 : (1.8) To find an for n 1, we multiply both sides of (1.7) by cos nx and integrate term by term, getting Z f .x / cos nx d x D D Z a0 2 a0 2 Z 1 X C k D1 C 1 X k D1 C 1 X k D1 Tak cos kx C bk sin kx U ! cos nx d x cos nx d x ak bk Z Z (1.9) cos kx cos nx d x sin kx cos nx d x : Using the orthogonality relations in Lemma 1.2, we see that all the terms on the right-hand side of (1.9) are equal to zero, except for Z an cos nx cos nx d x D an : 12.1 Computation of Fourier Series 715 Hence, equation (1.9) becomes Z D an ; for n 1; f .x / cos nx d x ; for n 0: f .x / cos nx d x so, including equation (1.8), 2 an D 1 Z (1.10) To find bn , we multiply equation (1.7) by sin nx and then integrate. By reasoning similar to the computation of an , we obtain bn D 1 Z f .x / sin nx d x ; for n 1. (1.11) Definition of Fourier series If f is a piecewise continuous function on the interval T ; U, we can compute the coefficients an and bn using (1.10) and (1.11). Thus we can define the Fourier series for any such function. DEFINITION 1.12 Suppose that f is a piecewise continuous function on the interval T ; U. With the coefficients computed using (1.10) and (1.11) , we define the Fourier series associated to f by f .x / a0 2 C 1 X n D1 [an cos nx C bn sin nx] : (1.13) The finite sum S N .x / D C a0 2 N X n D1 [an cos nx C bn sin nx] (1.14) is called the partial sum of order N for the Fourier series in (1.13). We say that the Fourier series converges at x if the sequence of partial sums converges at x as N ! 1: We use the symbol in (1.13) because we cannot be sure that the series converges. We will explore the question of convergence in the next section, and we will see in Theorem 2.3 that for functions that are minimally well behaved, the can be replaced by an equals sign for most values of x. EXAMPLE 1.15 ◆ Find the Fourier series associated with the function f .x / D ( 0; for x < 0, x ; for 0 x : We used the expression a0 =2 instead of a0 for the constant term in the Fourier series (1.7) so formulas like equation (1.10) would be true for n D 0 as well as for larger n. 2 716 Chapter 12 Fourier Series We compute the coefficient a0 using (1.8) or (1.10). We have a0 For n Z D 1 f .x / d x D 1 Z . x/ dx 0 D 2 : 1, we use (1.10), and integrate by parts to get an D 1 Z D n1 D D Z f .x / cos nx d x . 0 Z . x / cos nx d x 0 x / d sin nx x / sin nx 1 . n 1 .1 2 n D 1 0 C 1 n Z sin nx d x 0 cos n /: Thus, since cos n D . 1/n , the even numbered coefficients are a2n odd numbered coefficients are a2nC1 D 2=T.2n C 1/2 U for n 0: We compute bn using (1.11). Again we integrate by parts to get bn D D D f .x / sin nx d x Z D 1 Z . x / sin nx d x 0 1 . x / d cos nx n 0 Z 1 1 . x / cos nx cos nx d x n n 0 0 D n1 : |an| and |bn| The magnitude of the coefficients is plotted in Figure 3, with jan j in black and jbn j in blue. Notice how the coefficients decay to 0. The Fourier series for f is 1 0 0 Z 1 D 0, and the 10 20 30 n Figure 3 The Fourier coefficients for the function in Example 1.15. f .x / C 2 4 1 X cos.2n C 1/x .2n C 1/2 n D0 C 1 X sin nx : n n D1 (1.16) ◆ Let’s examine the experimental evidence for convergence of the Fourier series in Example 1.15. The partial sums of orders 3, 30, and 300 for the Fourier series in Example 1.15 are shown in Figures 4, 5, and 6, respectively. In these figures the function f is plotted in black and the partial sum in blue. The evidence of these figures is that the Fourier series converges to f .x /, at least away from the discontinuity of the function at x D 0: 12.1 Computation of Fourier Series π π 0 −π 0 π Figure 4 The partial sum of order 3 for the function in Example 1.15. π 0 x 0 −π 717 π x Figure 5 The partial sum of order 30 for the function in Example 1.15. 0 0 −π π x Figure 6 The partial sum of order 300 for the function in Example 1.15. Fourier series on a more general interval It is very natural to consider functions defined on T ; U when studying Fourier series because in applications the argument x is frequently an angle. However, in other applications (such as heat transfer and the vibrating string) the argument represents a length. In such a case it is more natural to assume that x is in an interval of the form T L ; L U. It is a matter of a simple change of variable to go from T ; U to a more general integral. Suppose that f .x / is defined for L x L : Then the function F . y / D f . L y =/ is defined for y . For F we have the Fourier series defined in Definition 1.20. Using the formula y D x = L, the coefficients an are given by an D 1 D 1 D L1 Z Z Z L F . y / cos ny d y f Ly f .x / cos L cos ny d y n x dx: L The formula for bn is derived similarly. Thus equations (1.10) and (1.11) are the special case for L D of the following more general result. THEOREM 1.17 If f .x / D a0 =2 C P1 n D1 an bn Tan cos.n x = L / C bn sin.n x = L /U for D D Z L 1 L Z 1 L L L L n x d x ; for n 0; L n x f .x / sin d x ; for n 1: L f .x / cos L x L, then (1.18) (1.19) Keep in mind that Theorem 1.17 only shows that if f can be expressed as a Fourier series, then the coefficients an and bn must be given by the formulas in (1.18) and (1.19). The theorem does not say that an arbitrary function can be expanded into a convergent Fourier series. 718 Chapter 12 Fourier Series The special case when n 1, it says D 0 in (1.18) deserves special attention. Since cos 0 D a0 D 1 L Z L f .x / d x : L Thus a0 =2 is the average of f over the interval T L ; L U: We will also extend Definition 1.12 to functions defined on the interval T L ; L U. DEFINITION 1.20 Suppose that f is a piecewise continuous function on the interval T L ; L U. With the coefficients computed using (1.18) and (1.19), we define the Fourier series associated to f by f .x / a0 2 C 1 h X n D1 an cos n x n x i C bn sin : L L (1.21) Even and odd functions The computation of the Fourier coefficients can often be facilitated by taking note of the symmetries of the function f . DEFINITION 1.22 A function f .x / defined on an interval L x said to be even if f . x / D f .x / for L x L, and odd if f . x / D for L L is f .x / x L. The graph of an even function is symmetric about the y-axis as shown in Figure 7. Examples include f .x / D x 2 and f .x / D cos x. The graph of an odd function is symmetric about the origin as shown in Figure 8. Examples include f .x / D x 3 and f .x / D sin x. f(x) f(x) f(−a) = −f(a) −a −L a 0 L x a −L −a 0 L x f(−a) = f(a) Figure 7 The graph of an even function. Figure 8 The graph of an odd function. The following properties follow from the definition. PROPOSITION 1.23 Suppose that f and g are defined on the interval L 1. If both f and g are even, then f g is even. x L. 12.1 Computation of Fourier Series 2. If both f and g are odd, then f g is even. 3. If f is even and g is odd, then f g is odd. 4. If f is even, then Z L f .x / d x L 5. If f is odd, then Z L D2 Z L 719 f .x / d x : 0 f .x / d x L D 0: We will leave the proof for the exercises. If we remember that the integral of f computes the algebraic area under the graph of f , parts 4 and 5 of Proposition 1.23 can be seen in Figures 7 and 8. The Fourier coefficients of even and odd functions Parts 4 and 5 of Proposition 1.23 simplify the computation of the Fourier coefficients of a function that is either even or odd. For example, if f is even, then, since sin.n x = L / is odd, f .x / sin.n x = L / is odd by part 3 of Proposition 1.23, and by part 5, Z 1 L n x bn D f .x / sin d x D 0: L L L Consequently, no computations are necessary to find bn . Using similar reasoning, we see that f .x / cos.n x = L / is even, and therefore an D L1 Z L f .x / cos L n x dx L D L2 Z L f .x / cos 0 n x dx: L Frequently integrating from 0 to L is simpler than integrating from L to L. Just the opposite occurs for an odd function. In this case the an are zero and the bn can be expressed as an integral from 0 to L. We will leave this as an exercise. We summarize the preceding discussion in the following theorem. THEOREM 1.24 Suppose that f is piecewise continuous on the interval T L ; L U. 1. If f .x / is an even function, then its associated P Fourier series will involve only the cosine terms. That is, f .x / a0 =2 C n1D1 an cos.n x = L / with an D 2 L Z L f .x / cos 0 n x dx; L for n 0: 2. If f .x / is an odd function, thenP its associated Fourier series will involve only the sine terms. That is, f .x / 1 n D1 bn sin.n x = L / with bn D L2 Z L 0 f .x / sin n x dx; L for n 1: 720 Chapter 12 Fourier Series Let’s look at another example of a Fourier series. EXAMPLE 1.25 ◆ Find the Fourier series associated to the function f .x / D x on x . The function f is odd, so according to Theorem 1.24 its Fourier series will involve only the sine terms. The coefficients are bn D 2 Z x sin.nx / d x : 0 Using integration by parts, we obtain |bn | bn D 2 cos n C n 1 n Z cos n x d x 0 D 2. 1/nC1 : n Thus, the Fourier series of f .x / D x on the interval T ; U is 1 f .x / 2 0 0 10 20 30 1 X . 1/nC1 n D1 n sin nx : (1.26) ◆ n The magnitude of the coefficients is plotted in Figure 9. The an are not shown, since they are all equal to 0. The partial sums of orders 5, 11, and 51 for the Fourier series in (1.26) are shown in Figures 10, 11, and 12 respectively. In these figures the function f .x / D x is plotted in black and the partial sum in blue. These figures provide evidence that the Fourier series converges to f .x /, at least on the open interval . ; /. At x D every term in the series is equal to 0. Therefore the series converges to 0 at , but not to f ./ D . Figure 9 The Fourier coefficients for the function in Example 1.25. π π 0 0 −π π x π 0 0 −π π x 0 Figure 10 The partial sum of order 5 for f (x) = x. π x −π −π −π 0 −π Figure 11 The partial sum of order 11 for f (x) = x. Figure 12 The partial sum of order 51 for f (x) = x. EXAMPLE 1.27 ◆ Compute the Fourier series for the saw-tooth wave f graphed in Figure 13 on the interval T 1; 1U. The graph in Figure 13 on the interval T 1; 1U consists of two lines with slope C2 and 2 respectively. The formula for f on the interval f .x / D ( 1 C 2x ; if 1 x 0; 1 2x ; if 0 x 1: 1x 1 is given by 12.1 Computation of Fourier Series 721 1 0 −3 −2 0 −1 1 2 3 x −1 Figure 13 A saw-tooth shaped wave. The function f is even and is periodic with period 2. Since f is an even function, we see using Theorem 1.24 that only the cosine terms appear in the Fourier series, and the coefficients are given by an For n D2 Z 1 .1 2x / cos.n x / d x ; for n 0 0: D 0 we can compute the integral by observation, a0 D2 Z 1 .1 2x / d x 0 D 0: For n > 0; we use integration by parts to obtain an Since cos n D2 D. a2n |an | 1 Z 1 .1 0 D0 and a2nC1 f .x / 10 20 30 Figure 14 The Fourier coefficients for the function in Example 1.27. n D n 24 2 .1 cos n /: 1/n , we see that Thus we have 0 0 2x / cos.n x / d x 1 8 X 2 n D0 D .2n C81/2 2 ; 1 .2n C 1/2 for n 0: cos..2n C 1/ x /: ◆ The magnitude of the coefficients is plotted in Figure 14. The bn are not shown, since they are all equal to 0. Notice how fast the coefficients decay to 0, in comparison to those in Figures 3 and 9. The graph of the partial sum of order 3, S3 . x / D 8 2 cos x C 1 cos 3 x ; 9 is shown in Figure 15. The sum of these two terms gives a pretty accurate approximation of the saw-tooth wave. This reflects the fact that the coefficients decay rapidly, as shown in Figure 14. The partial sum of order 9 is plotted in Figure 16. Notice that the poorest approximation occurs at the “corners” of the graph of the saw-tooth. This is where the function fails to be differentiable, and these facts are connected. EXAMPLE 1.28 ◆ Find the Fourier series of the function f .x / T ; U. D sin 3x C 2 cos 4x on the interval 722 Chapter 12 Fourier Series 1 0 −3 1 −1 3 x −1 Figure 15 The partial sum of order 3 for the saw-tooth function. 1 0 −3 1 −1 3 x −1 Figure 16 The partial sum of order 9 for the saw-tooth function. Since f is already given as a sum of sines and cosines, no work is needed. The Fourier series of f is just sin 3x C 2 cos 4x. This example illustrates an important point. According to Theorem 1.17, the Fourier coefficients of a function are uniquely determined by the function. Thus, by inspection, b3 D 1, a4 D 2 and all other coefficients are equal to 0. By uniqueness, these are the same values as would have been obtained by computing the integrals in Theorem 1.17 for the an and bn . ◆ EXAMPLE 1.29 ◆ Find the Fourier series of the function f .x / D sin2 x on the interval T ; U. In this example, f is not explicitly given as a linear combination of sines and cosines, so there is some work to do. However, if we use the trigonometric identity sin2 x D 12 .1 cos 2x /; the right side is the desired Fourier series, since it is a finite linear combination of terms of the form cos nx. ◆ ................ EXERCISES In Exercises 1–6 expand the given function in a Fourier series valid on the interval x . Plot the function and two partial sums of your choice over the interval x . Plot the same partial sums over the interval 3 x 3 . 1. f .x / D j sin x j 2. f .x / D jx j 12.1 Computation of Fourier Series 3. f .x / D 4. f .x / D ( ( 723 0; x < 0; x ; 0 x : 0; x < 0; sin x ; 0 x : 5. f .x / D x cos x 6. f .x / D x sin x In Exercises 7–16 find the Fourier series for the indicated function on the indicated interval. Plot the function and two partial sums of your choice over the interval. 7. f .x / D ( 8. f .x / D 4 1 C x ; for 1 x 0, on T 1; 1U 1; for 0 < x 1 x 2 on T 2; 2U 9. f .x / D x 3 on T 1; 1U 10. f .x / D sin x cos2 x on T ; U 11. f .x / D 12. f .x / D 13. f .x / D 14. f .x / D 15. f .x / D 16. f .x / D ( ( ( ( ( ( 0; for 1 x 0, on T 1; 1U x 2 ; for 0 < x 1 sin x =2; for 2 x 0, on T 2; 2U 0; for 0 < x 2 cos x ; for 1 x 0, on T 1; 1U 1; for 0 < x 1 1 C x ; for 1 x 0, on T 1; 1U 1 x ; for 0 < x 1 2 C x; for 2 x 0, on T 2; 2U 2 C x ; for 0 < x 2 2; for 2 x 0, on T 2; 2U 2 x ; for 0 < x 2 17. Expand the function f .x / D x 2 in a Fourier series valid on the interval x . Plot both f and the partial sum S N for N D 1; 3; 5; 7. Observe how the graphs of the partial sums approximate the graph of f . Plot the same graphs over the interval 2 x 2 . 18. Expand the function f .x / D x 2 in a Fourier series valid on the interval 1 x 1. Plot both f and the partial sum S N for N D 1; 3; 5; 7. Observe how the graphs of the partial sums approximate the graph of f . Plot the same graphs over the interval 2 x 2. 724 Chapter 12 Fourier Series In Exercises 19–22 determine if the function f is even, odd, or neither. 19. f .x / D j sin x j 20. f .x / D x C 3x 3 22. f .x / D x C x2 21. f .x / D e x 23. Use the addition formulas for sin and cos to show that cos cos D 12 Tcos. / C cos. C /U; sin sin D 12 Tcos. / sin cos D 12 Tsin. / C sin. C /U: cos. C /U; 24. Prove Lemma 1.2. Hint: Use Exercise 23. 25. Complete the derivation of equation 1.11 for the coefficient bn : 26. Prove parts 1, 2, and 3 of Proposition 1.23. 27. Prove parts 4 and 5 of Proposition 1.23. 28. Prove part 2 of Theorem 1.24. 29. From Theorem 1.24, the Fourier series of an odd function consists only of sineterms. What additional symmetry conditions on f will imply that the sine coefficients with even indices will be zero? Give an example of a function satisfying this additional condition. 30. Suppose that f is a function which is periodic with period T and differentiable. Show that f 0 is also periodic with period T . 31. Suppose that f is a function defined on R. Show that there is an odd function f odd and an even function f even such that f .x / D f odd.x / C f even .x / for all x. 12.2 Convergence of Fourier Series Suppose that f is a piecewise continuous function on the interval T L ; L U; and that f .x / a0 2 C 1 h X n D1 an cos n x L C bn sin n x i L (2.1) is its associated Fourier series. Two questions arise immediately whenever an infinite series is encountered. The first question is, does the series converge? The second question arises if the series converges. Can we identify the sum of the series? In particular, does the Fourier series of a function f converge at x to f .x / or to something else? These are the questions we will address in this section.3 Theorem 1.17 does not answer this question, since it assumes that f .x / equals its Fourier series and then describes what the Fourier coefficients have to be. 3 12.2 Convergence of Fourier Series 725 Fourier Series and periodic functions The partial sums of the Fourier series in (2.1) have the form S N .x / D a0 2 C N h X n D1 an cos n x L C bn sin n x i L : (2.2) The function S N .x / is a finite linear combination of the trigonometric functions cos.n x = L / and sin.n x = L /, each of which is periodic with period 2L.4 Hence for every N the partial sum S N is a function that is periodic with period 2L. Consequently, if the partial sums converge at each point x, the limit function must also be periodic with period 2L : Let’s consider again the function f .x / D x, which we treated in Example 1.25. f .x / is defined for all real numbers x, and it is not periodic. We found that its Fourier series on the interval [ ; ] is 2 1 X . 1/nC1 n D1 n sin nx : The partial sums of this series are all periodic with period 2 . Therefore, if the Fourier series converges, the limit function will be periodic with period 2 . Thus the limit cannot be equal to f .x / D x everywhere. The evidence from the graphs of the partial sums in Figures 10, 11, and 12 of the previous section indicates that the series does converge to f .x / D x on the interval . ; /. Since the limit must be 2 -periodic, we expect that the limit is closely related to the periodic extension of f .x / D x from the interval . ; /. The situation is illustrated in Figure 1, which shows the partial sum of order 5 over 3 periods. The periodic extension of f .x / D x is shown plotted in black. Since it will appear repeatedly, let’s denote the periodic extension of a function f .x / defined on an interval T L ; L U by f p .x /. Usually it is easier to understand the periodic extension of a function graphically than it is to give an understandable formula for it. This is illustrated for f .x / D x in Figure 1. However, for the record, the formula for the periodic extension5 is f p .x / D f .x 2kL / for .2k 1/ L < x .2k C 1/ L : You will notice that f p is periodic with period 2L : To get a feeling for whether or not the Fourier series of f .x / D x converges to its periodic extension f p , we graph both f p and the partial sum of order 21 in Figure 2. Note that the graph of S21 (the blue curve) is close to the graph of f p except at the points of discontinuity of f p , which occur at the odd multiples of : The accuracy of the approximation of f p .x / by S21.x / gets worse as x gets closer We studied periodic functions in Section 5.5, but let’s refresh our memory. A function g .x / is periodic with period T if g .x C T / D g .x / for all x. Notice that every integral multiple of a period is also a period. The smallest period of cos.n x = L / and sin.n x = L / is 2L = n, so n .2L = n / D 2L is also a period. Thus each function in the partial sum SN in (2.2) is periodic with period 2L. 5 Notice we use less than (<) at the lower endpoint of each interval and less than or equal () at the upper endpoint. A choice is necessary to avoid having two values at the endpoints. This is not the only possible choice, but it is as good as any. 4 726 Chapter 12 Fourier Series π 0 −3π −π 3π π x −π Figure 1 The partial sum of order 5 for the series in Example 1.25 over three periods. π 0 −3π −π 3π π x −π Figure 2 The partial sum of order 21 for the series in Example 1.25 over three periods. to a point of discontinuity. This is necessary, simply because each partial sum is a continuous function, while f p is not. Furthermore, we see that S N ./ D 0 for all N . Hence the Fourier series converges to 0 at , and not to f p ./ D : The same phenomenon occurs at x D .2k C 1/ for any integer k, and these are the points of discontinuity of f p . We will see these considerations reflected in our convergence theorem. Piecewise continuous functions Suppose that f is a function defined in an interval I. We define the right-hand and left-hand limits of f at a point x 0 to be f .x 0C / D lim f .x / and x ! x 0C f .x 0 / D lim f .x /: x !x0 The function f is continuous at x 0 if and only if both limits exist and f .x 0C / D f .x 0 / D f .x 0 /: In Section 5.1, we defined a function f to be piecewise continuous if it has only finitely many points of discontinuity in any finite interval, and if both the leftand right-hand limits exist at every point of discontinuity. Thus, for a piecewise continuous function the left- and right-hand limits exist everywhere. You will notice that the periodic extension f p of f .x / D x on the interval T ; U that we saw in Example 1.25 is piecewise continuous. The points of discontinuity for f p are at .2k C 1/ , the odd integral multiples of . We have f p .T.2k C 1/ UC/ D and f p .T.2k C 1/ U / D . In fact, if f is any function that is continuous on the interval T L ; L U, then the periodic extension f p is piece- 12.2 Convergence of Fourier Series 727 wise continuous on all of R, and its only possible points of discontinuity are the odd multiples of L. We will say that the function f has left-hand derivative at x 0 if the left-hand limit f .x 0 / exists and the limit lim x !x0 f .x / x f .x 0 / / x0 exists. Similarly, we will say that f has right-hand derivative at x 0 if f .x 0C / exists and the limit f .x / f .x 0C / lim x x0 x ! x 0C exists. If f is differentiable at x 0 , then f has left- and right-hand derivatives there and both are equal to f 0 .x 0 /: For an example, we consider again the periodic extension f p of f .x / D x on the interval T ; U. The left- and right-hand derivatives exist at every point and are equal to 1, even at the points of discontinuity. Another example is the saw-tooth wave in Example 1.27. Notice that the saw-tooth function is continuous everywhere, but fails to be differentiable where x is an integer. However, at these points the leftand right-hand derivatives of the saw-tooth wave exist. Convergence Since a Fourier series converges to a periodic function, we may as well assume from the beginning that the function f is already periodic. If, as was the case in Example 1.25, we are given a function that is not periodic, then it is necessary to look at the periodic extension of the function. We are now in a position to state our main theorem on the convergence of Fourier series. A proof is beyond the scope of this text, but one can be found in any advanced book on Fourier series. THEOREM 2.3 Suppose f .x / is a piecewise continuous function that is periodic with period 2L. If the left- and right-hand derivatives of f exist at x 0 then the Fourier series for f converges at x 0 to f .x 0C / C f .x 0 / : 2 If f is continuous at x 0 , then f .x 0C / D f .x 0 / D f .x 0 /, so assuming that the left- and right-hand derivatives of f exist at x 0 , Theorem 2.3 concludes that the Fourier series converges at x 0 to f .x 0 /. Theorem 2.3 assumes the existence of the left- and right-hand derivatives of f only at the point x 0 , and concludes that the Fourier series converges only at x 0 . This indicates that it is only the smoothness of f near x 0 that affects the convergence there. However, in most of the examples that we will consider, the left- and righthand derivatives will exist everywhere. We will consider this special case in the next corollary. 728 Chapter 12 Fourier Series COROLLARY 2.4 Suppose f .x / is a piecewise continuous function that is periodic with period 2L. Suppose in addition that f has left- and right-hand derivatives at every point. 1. At every point x 0 where f is continuous the Fourier series for f converges to f . x 0 /. 2. At every point x 0 where f is not continuous the Fourier series for f converges to f .x 0C / C f .x 0 / : 2 (2.5) EXAMPLE 2.6 ◆ We have verified that the hypothesis of Corollary 2.4 holds for the periodic extension f p of f .x / D x on x . Show that the conclusion of Corollary 2.4 holds at any point of discontinuity. The points of discontinuity are .2k C 1/ , the odd integral multiples of . We have f p .T.2k C 1/ UC / D and f p .T.2k C 1/ U / D . Therefore, f p .T.2k C 1/ UC / C f p .T.2k C 1/ U / 2 We have also seen that the Fourier series of f is 2 1 X . 1/nC1 n D1 n D 0: sin nx : When x D .2k C 1/ every term in the series is equal to 0. Hence the series converges to 0, so the conclusion of Theorem 2.5 is valid at x D .2k C 1/ . ◆ x 2 on the interval 1 x 1. Without computing the Fourier coefficients, explicitly describe the sum of the Fourier series of f for all x.6 EXAMPLE 2.7 ◆ Let f .x / D Of course, f .x / D x 2 is not periodic. Therefore, we must consider its periodic extension, f p , graphed in black in Figure 3. Note that f p is continuous everywhere, and it is differentiable except at the odd integers, x D 2k C 1. At these points the left- and right-hand derivatives exist. Thus the left- and right-hand derivatives exist everywhere, and Corollary 2.4 implies that its Fourier series converges to f p .x / for all x. ◆ EXAMPLE 2.8 ◆ Consider the function f .x / D 8 > < 1; 0; 1; > : for 1 x 0, for x D 0, for 0 < x 1: Find the Fourier series for f , and describe the sum of its Fourier series. 6 The computation of this series is Exercise 18 in Section 1. 12.2 Convergence of Fourier Series 729 1 0 −3 1 −1 3 x Figure 3 The partial sum S5 (x) for the function in Example 2.7. Since f is only defined over the interval T 1; 1U, we are really looking at the Fourier series of its periodic extension f p , shown plotted in black in Figure 4. For obvious reasons, f p is called the square wave. Since f (and f p ) is an odd function, Theorem 1.24 says that only the sine terms are present in the Fourier series, and that the coefficients are bn D2 Z 1 f .x / sin n x d x 0 Hence b2n D0 D2 Z 1 sin n x d x 0 and b2nC1 D 2 T. 1/n n 1 U: D .2n C4 1/ : The Fourier series associated to f p (and to f ) is f p .x / 1 4X 1 nD0 2n C 1 sin.2n C 1/ x : (2.9) The function f p is piecewise continuous, with discontinuities at all of the integers. In addition, its left- and right-hand derivatives exist everywhere. Thus, the Fourier series converges to f p .x / if x is not an integer. If x D k is an integer, the series converges to f p .k C / C f p .k / 1 C . 1/ D D 0: 2 2 In fact, each term of the Fourier series in (2.9) is equal to 0 when x D k is an integer. The partial sum of the Fourier series of order 11 is shown plotted in Figure 4. ◆ Gibb’s phenomenon Suppose that the piecewise continuous function f has a discontinuity at x 0 , but that the left- and right-hand derivatives of f exist at x 0 . As Theorem 2.3 points out, the Fourier series of f converges at x 0 to T f .x 0C / C f .x 0 /U=2. However, if you look closely at the graphs of the partial sums near the points of discontinuity in Figures 1, 2, and 4, we see that the graph of the partial sum overreaches the graph of the function on each side of the discontinuity. This effect is called Gibb’s phenomenon. To examine Gibb’s phenomenon a little more deeply, let’s look at the graphs of some high order partial sums for the square wave. The partial sums S301 and S601 730 Chapter 12 Fourier Series 1 0 −3 1 −1 3 x −1 Figure 4 The partial sum S11 (x) for the square wave in Example 2.8. 1 1 0 0.01 −0.01 0 x 0.01 −0.01 −1 −1 Figure 5 The partial sum S301 (x) for the square wave. Figure 6 The partial sum S601 (x) for the square wave. x are plotted in Figures 5 and 6, but only for 0:01 x 0:01; so that we may see the overrun clearly. Notice that both partial sums display the overrun that is characteristic of Gibb’s phenomenon. In the two cases the amount of the overrun is approximately the same, but for the higher order sum the duration is smaller. It can be proved that whenever a function f satisfies the hypotheses of Theorem 2.3, but has a discontinuity at x 0 , the graphs of the partial sums of the Fourier series display Gibb’s phenomenon near x 0 . Furthermore, the ratio of the length of the interval between the upper peak and the lower peak of the partial sum to j f .x0C/ f .x0 /j is approximately 1:179 in every case. The Riemann–Lebesgue Lemma Notice that in every example we have considered, the Fourier coefficients approach 0 as the frequency gets large. This is demonstrated, in particular, in Figures 3, 9, and 14 in Section 1. These examples are typical of the behavior of Fourier coefficients, as the next theorem, known as the Riemann-Lebesgue lemma, shows. THEOREM 2.10 Suppose f is a piecewise continuous function on the interval a x Z b lim k !1 a f .x / cos kx d x D klim !1 Z b a f .x / sin kx d x b. Then D 0: As we will see in Section 5, this theorem has important applications. Basically, this theorem states that any given signal can be approximated very well by a few dominant Fourier coefficients because most of the Fourier coefficients are near zero. 12.2 Convergence of Fourier Series 731 The intuitive reason behind this theorem is that as k gets very large, sin kx and cos kx oscillate much more rapidly than does f (see Figures 1 and 2 in Section 1). If k is large, f .x / is nearly constant on two adjacent periods of sin kx or cos kx. The integral over each period is almost zero, since the areas above and below the x-axis almost cancel. Interpretation of the Fourier coefficients Suppose that f is a function that satisfies the hypotheses of Corollary 2.4. Then f .x / is equal to its Fourier series f .x / D a0 2 C 1 h X n D1 an cos n x L C bn sin n x i L ; (2.11) except at those points where f is not continuous. Let’s look more closely at the nth summand, which we can rewrite in terms of its amplitude and phase7 as f n .x / D an cos n x L C bn sin n x L D An cos n x L n ; (2.12) p where An D an2 C bn2 and tan n D bn =an : We see that f n .x /, defined in (2.12), is an oscillation with amplitude An and frequency8 !n D n = L : We will call f n the component of f at frequency !n D n = L : Notice that !n D n !1 , where !1 D = L, so all of the frequencies are integer multiples of the fundamental frequency !1 . We can interpret Corollary 2.4 as saying that any function that satisfies its hypotheses is an infinite linear combination of oscillatory components at frequencies that are integer multiples of the fundamental frequency. The component of f at p frequency !n has amplitude An D an2 C bn2 . The amplitude is a numerical measure of the importance of the component in the Fourier expansion. By the Riemann– Lebesgue lemma, the Fourier coefficients decay to 0 as n increases, so the amplitudes An do as well. As a result, the components at the smaller frequencies dominate the Fourier series in (2.11). This fact is illustrated by the plots of the magnitudes of the coefficients in Figures 3, 9, and 14 in Section 1. Fourier coefficients for periodic functions In this section we have been looking at periodic functions, since it is only such functions that can be the sums of Fourier series. It is worth pointing out that for a periodic function with period 2L, the coefficients can be computed by an integral over any interval of length 2L. More precisely, we have the following: 7 See Section 4.4. This is an angular frequency. Remember that we are using angular frequencies instead of numerical frequencies unless otherwise stated. 8 732 Chapter 12 Fourier Series PROPOSITION 2.13 Suppose that f is a piecewise continuous function that is periodic with period 2L. Then for any c the Fourier coefficients for f are given by an bn D L1 D 1 L Z cC2L c Z cC2L c n x dx; L n x f .x / sin dx; L f .x / cos for n 0; for n 1: We will leave the proof to the exercises. ................ EXERCISES In Exercises 1–6 determine if the function f is periodic or not. If it is periodic, find the smallest positive period. 1. f .x / D j sin x j 2. f .x / D cos 3 x 3. f .x / D x 4. f .x / D sin.x / C cos.x =2/ 5. f .x / D x 2 6. f .x / D e x In Exercises 7–14 find the sum of the Fourier series for indicated function at every point in R without computing the series. Each of these is an exercise in Section 1. Although that is not very important, the reference is included in parentheses. 7. f .x / D 8. f .x / D 9. f .x / D ( ( ( 10. f .x / D 4 0; x < 0; on T ; U (See Exercise 1.3) x; 0 x 0; x < 0; on T ; U (See Exercise 1.4) sin x ; 0 x 1 C x ; for 1 x 0 on T 1; 1U (See Exercise 1.7) 1; for 0 < x 1 x 2 on T 2; 2U (See Exercise 1.8) 11. f .x / D x 3 on T 1; 1U (See Exercise 1.9) 12. f .x / D 13. f .x / D ( ( 0; for 1 x 0; on T 1; 1U (See Exercise 1.11) x 2 ; for 0 < x 1 sin x =2; for 2 x 0, on T 2; 2U (See Exercise 1.12) 0; for 0 < x 2 12.2 14. f .x / D ( Convergence of Fourier Series 733 2; for 2 x 0, on T 2; 2U (See Exercise 1.16) 2 x ; for 0 < x 2 15. Compute the Fourier series for the function f .x / D jx j on the interval T ; U: (See Exercise 1.2.) Use the result and Theorem 2.3 to show that 1 X n D0 D : 2 .2n C 1/ 8 2 1 16. Compute the Fourier series for the function f .x / D x 2 on the interval T ; U: (See Example 2.7.) Use the result and Theorem 2.3 to show that 1 X . 1/nC1 n D1 n2 D 12 2 and 1 X 1 n2 n D1 D 6 : 2 17. Compute the Fourier series for the function f .x / D x 4 on the interval T ; U: Use the result, Theorem 2.3, and Exercise 16 to show that 1 X . 1/nC1 n D1 n4 D 7120 4 and 1 X 1 n4 n D1 D 90 : 4 18. Expand the function f .x / D 8 > <0; 1 < x 1=2; 1; 1=2 < x 1=2; > : 0; 1=2 < x 1; in a Fourier series valid on the interval 1 x 1. Plot the graph of f and the partial sums of order N for N D 5; 10; 20; and 40, as in Exercise 17 in Section 1. Notice how much slower the series converges to f in this example than in Exercise 17 in Section 1. What accounts for the slow rate of convergence in this example? 19. Expand the function f .x / D er x in a Fourier series valid for x . For the case r D 1=2, plot the partial sums of orders N D 10; 20; and 30 of the Fourier series along with the graph of f p over the intervals x and 2 x 2 . 20. Use the previous exercise to compute the Fourier coefficients for the function f .x / D sinh x D .e x e x /=2 and f .x / D cosh.x / D .e x C e x /=2 over the interval x . 21. Use Theorem 2.3 to determine the sum of the Fourier series of the function f defined in Exercise 18 for each x in the interval 1 x 1. 22. Suppose that f is periodic with period T and differntiable. Show that f 0 is also periodic with period T . 734 Chapter 12 Fourier Series 23. Suppose that f is periodic with period T . Show that Z b CT f .x / d x b D Z a CT f .x / d x a for any a and b. Use this result to prove Proposition 2.13. 24. Suppose that f is periodic with period T . Define Z x F .x / D RT Show that if Exercise 23.) 0 f .y/ d y f .y/ d y: 0 D 0, then F is periodic with period T . (Hint: Use 12.3 Fourier Cosine and Sine Series In this section we will examine the possibility of finding Fourier series of the forms f .x / D 1 X n D1 and f .x / D a0 2 C bn sin 1 X n D1 n x ; L an cos for 0 x n x ; L L; for 0 x L: The basic idea behind our method comes from Theorem 1.24. Fourier cosine series According to Theorem 1.24, the Fourier series of an even function contains only cosine terms. If the function f .x / is defined only for 0 x L, we extend it to L x 0 as an even function. The even extension of f is defined by fe (x) 2 f e .x / D 1 f(x) = ex 0 −1 0 1 x Figure 1 The even extension of f (x ) = e x . ( if 0 x L, if L x < 0: f .x /; f . x /; For the function f .x / D e x on the interval T0; 1U, the even extension f e is plotted in blue in Figure 1. Since the function f e is an even function defined on T L ; L U, Theorem 1.24 tells us that its Fourier series has the form f e .x / a0 2 D 2 L where an C 1 X n D1 Z L 0 an cos f e .x / cos n x ; L for n x dx; L L x L; for n 0: (3.1) 12.3 Since f e .x / D f .x / for 0 x an Z L D L2 Fourier Cosine and Sine Series 735 L, this formula becomes f .x / cos 0 n x dx; L for n 0: (3.2) Furthermore, if we restrict ourselves to the interval T0; L U, where f e .x / D f .x /, we can write f .x / a0 2 C 1 X n D1 an cos n x L ; for 0 x L; (3.3) with the coefficients given by (3.2). The series in (3.3), with the coefficients given in (3.2), is called the Fourier cosine series for f on the interval T0; L U. EXAMPLE 3.4 ◆ Find the Fourier cosine series for f .x / D e x on the interval T0; 1U: The coefficients in (3.2) become |an | an D2 Z 1 e x cos n x d x 0 D 1 C 2n 2 2 . 1 /n e 1 : This evaluation can be done by direct computation, by looking the integral up in an integral table, or by using a computer and a symbolic algebra program. The magnitude of these coefficients is plotted in Figure 2. Notice how quickly the coefficients decay to 0. The Fourier series is 1 0 0 10 n ex Figure 2 The Fourier cosine coefficients for f (x) = e x . .e .e 1/ C 2 1/ 1 X n D1 . 1/n e 1C n2 1 2 2 .e C 1 / cos x 1 C 2 cos n x C 2.e 1/ cos 2 x 1 C 4 2 (3.5) C::: on the interval T0; 1U: The partial sum S3.x / is plotted in blue in Figure 3. The black curve in Figure 3 is the periodic extension of the even extension of the function f .x / D e x . We will call this the even periodic extension of f , and we will denote it by f ep . Since, in this case, f ep is continuous and satisfies the hypotheses of Corollary 2.4, the Fourier series converges everywhere to f ep .x /. ◆ 2 Fourier sine series 0 In a similar manner, a function f can be expanded in a series which involves only sine terms. Again motivated by Theorem 1.24, we consider the odd extension of f , which is defined by x f(x) = e 0 −1 1 −2 fo (x) Figure 4 The odd extension of f (x ) = e x . x f o .x / D 8 > < f .x /; 0; > : f . x /; if 0 < x L ; if x D 0; if L x < 0: The odd extension of f .x / D e x is plotted in blue in Figure 4. Since the function f o 736 Chapter 12 Fourier Series 2 1 0 −3 −2 0 −1 1 2 3 x Figure 3 The partial sum S3 of the Fourier cosine series for f (x) = e x plotted over three periods. is an odd function defined on T L ; L U, Theorem 1.24 tells us that its Fourier series has only sine terms. Proceeding as before, we find that f .x / where 1 X n D1 Z L bn sin nx ; for 0 < x L; (3.6) n x d x ; for n 1: (3.7) L 0 The series in (3.6), with the coefficients given in (3.7), is called the Fourier sine series for f on the interval T0; L U. bn D L2 f .x / sin EXAMPLE 3.8 ◆ Find the Fourier sine series for f .x / D e x on the interval T0; 1U: The coefficients in (3.7) become bn D2 Z 1 e x sin n x d x 0 D 2n 1T1C n.2 12 / eU : n This evaluation can be done by direct computation, by looking the integral up in an integral table, or by using a computer and a symbolic algebra program. Thus we have 1 2n T1 . 1/n eU X ex sin n x 2 2 1 C n n D1 (3.9) 2.e C 1/ 4.e 1/ 6.e C 1/ 1 C 2 sin x 1 C 4 2 sin 2 x C 1 C 9 2 sin 3 x C : : : 2 0 −3 −2 0 −1 1 2 −2 Figure 6 The partial sum S3 of the Fourier sine series for f (x) = e x plotted over three periods. 3 x 12.3 Fourier Cosine and Sine Series 737 on the interval T0; 1U: The magnitude of the coefficients is plotted in Figure 5. Notice that the sine coefficients do not decay nearly as rapidly as do the cosine coefficients in Figure 2. The partial sum of order 3 is plotted in blue in Figure 6. It is interesting to compare this figure with Figure 3. The black curve in Figure 6 is the odd periodic extension of f .x / D e x , which we denote by f op . In this case f op satisfies the hypotheses of Corollary 2.4 and fails to be continuous only at the integers. Consequently, the Fourier sine series converges to f op .x / everywhere except at the integers. ◆ |bn | 1 0 0 10 n Note that while we used the even and odd extensions of f ( f e and f o ) to help derive the cosine and sine expansions, the formulas for an and bn involve only the function f on the interval T0; L U. This is reflected by the fact that the cosine and sine expansions converge to f only on .0; L /. Outside this interval the cosine and sine expansions converge to f ep and f op , respectively. Examples 3.4 and 3.8 illustrate these facts, but another example might help to put things into perspective. Figure 5 The Fourier sine coefficients for f (x) = e x . EXAMPLE 3.10 ◆ Find the complete Fourier series for f .x / D e x on the interval T 1; 1U: From (1.10) we have an D Z 1 e x cos n x d x 1 D. 1 /n e 1=e ; 1 C n2 2 for n 0; while from (1.11) we have bn e x sin n x d x 1 D. 1/nC1 n .e 1=e/ ; 1 C n2 2 for n 1. Again there are several ways to verify this. Hence the complete Fourier series for e x on T 1; 1U is |an| and |bn| ex 2 D e 1 e ( 1 2 1 X n C 1 .C n12/ 2 [cos n x n D1 ) n sin n x] : (3.11) The magnitude of the coefficients is plotted in Figure 7, with jan j in black and 1 0 0 D Z 1 10 n Figure 7 The coefficients of the complete Fourier series for f (x) = e x. jbn j in blue. The partial sum ofxorder 3 is plotted in blue Figure 8. The periodic extension of e satisfies the hypotheses of Corollary 2.4 and fails to be continuous only at the odd integers. Consequently, the Fourier series converges to the periodic extension everywhere except at the odd integers. ◆ Now we have three Fourier series that converge to f .x / D e x on the interval .0; 1/. The first in (3.5) contains only cosine terms. The second in (3.9) contains only sine terms. The third in (3.11) contains both sine and cosine terms. It is interesting to compare graphs of the partial sums in Figures 3, 6, and 8. The difference between the three is what happens outside of the interval .0; 1/. The cosine series converges to f ep , the even periodic extension of f . The sine series converges to f op , the odd periodic extension of f , except at the integers. And, finally, the full Fourier series converges to f p , the periodic extension of f , except at the odd integers. Of course, the same three series can be considered for any piecewise continuous function defined on an interval of the form T L ; L U. 738 Chapter 12 Fourier Series 2 1 −3 −2 −1 0 1 2 3 x Figure 8 The partial sum S3 of the complete Fourier series for f (x) = e x plotted over three periods. ................ EXERCISES In exercises 1–4 sketch the graph of the odd extension of the function f . Also sketch the graph of the odd periodic extension with period 2 over three periods. 1. f .x / D 1 x 2. f .x / D 1 3. f .x / D x 2x 2 1 4. f .x / D x 2 2 In exercises 5–8 sketch the graph of the even extension of the function f . Also sketch the graph of the even periodic extension with period 2 over three periods. 5. f .x / D 1 x 6. f .x / D 1 7. f .x / D x 2x 2 1 8. f .x / D x 2 2 In Exercises 9 – 20 expand the given function in a Fourier cosine series valid on the interval 0 x . Plot the function and two partial sums of your choice over the interval 0 x . Plot the same partial sums and the function the series converges to over the interval 3 x 3 . 9. f .x / D x 10. f .x / D sin x 11. f .x / D cos x 12. f .x / D 1 13. f .x / D 14. f .x / D x 2 15. f .x / D x 3 16. f .x / D x 4 x 12.3 17. f .x / D 18. f .x / D ( Fourier Cosine and Sine Series 739 ( 1; 0 x < =2; 0; =2 x x; 0 x < =2; =2; =2 x 19. f .x / D x cos x 20. f .x / D x sin x In Exercises 21 – 32 expand the given function in a Fourier sine series valid on the interval 0 x . Plot the function and two partial sums of your choice over the interval 0 x . Plot the same partial sums and the function the series converges to over the interval 3 x 3 . 21. Same as Exercise 9 22. Same as Exercise 10 23. Same as Exercise 11 24. Same as Exercise 12 25. Same as Exercise 13 26. Same as Exercise 14 27. Same as Exercise 15 28. Same as Exercise 16 29. Same as Exercise 17 30. Same as Exercise 18 31. Same as Exercise 19 32. Same as Exercise 20 33. Show that the functions cos.n x = L /, n interval T0; L U. This means that Z L D 0 ; 1; 2; : : : cos.n x = L / cos. p x = L / d x 0 D 0; are orthogonal on the if p 6D n : Hint: Use Exercise 23. 34. Show that the functions sin.n x = L /, n interval T0; L U. This means that Z L D 1; 2; 3; : : : are orthogonal on the sin.n x = L / sin. p x = L / d x 0 D 0; if p Hint: Use Exercise 23. 35. Show that Z 1 0 cos.2n x / sin.2k x / d x D 0: 6D n : 740 Chapter 12 Fourier Series Hint: Use Exercise 23. 36. If f .x / is continuous on the interval 0 x L, show that its even periodic extension is continuous everywhere. Does this statement hold for the odd periodic extension? What additional condition(s) is (are) necessary to ensure that the odd periodic extension is everywhere continuous? 12.4 The Complex Form of a Fourier Series If the piecewise continuous function f is periodic with period 2L, then its Fourier series is 1 n x n x i a0 X h f .x / C an cos C bn sin ; (4.1) 2 L L n D1 where the coefficients are given by an bn D D Z L 1 L Z 1 L L L L n x d x ; for n 0; and L n x f .x / sin d x ; for n 1: L f .x / cos (4.2) Sometimes it is useful to express the Fourier series in complex form using the complex exponentials, einx for n D 0; 1; 2; : : : . This is possible because of the close connection between the complex exponentials and the trigonometric functions. We explored this connection in the appendix to this book and in Section 4.3. The most important facts to know about the complex exponential are Euler’s formula eiy D cos y C i sin y ; (4.3) which defines the exponential, and that all of the familiar properties of the real exponential remain true for the complex exponential. If we write down Euler’s formula with y replaced by y, we get e iy D cos y i sin y : (4.4) Solving (4.3) and (4.4) for cos y and sin y, we see that cos y iy D e C2 e iy and sin y De iy e iy 2i : (4.5) Let’s substitute these expressions into the Fourier series (4.1). The nth term in the sum is the component of f at the frequency !n D n = L, and it becomes n x n x C bn sin L L an in x = L in x = L D2 e Ce C b2in ein x =L D an 2 i bn ein x =L C an C2 i bn e in x =L D n ein x =L C n e in x =L ; f n .x / D an cos e in x = L (4.6) 12.4 The Complex Form of a Fourier Series 741 where we have substituted n D an i bn and 2 n D an C2 i bn ; for n 1. (4.7) We will also write the constant term as f 0 .x / D 0 D a0 =2: Separating the positive and negative terms, the Fourier series can be written as f .x / 1 X nD 1 n ein x = L : (4.8) Notice that by (4.6), the component of f at frequency !n D n = L is given by f n .x / D n ei !n x C n e i !n x : As a result, when we talk in terms of low frequency components we have to consider the coefficients n and n for small values of n. We can use (4.2) to express the coefficients n in terms of the function f . For example, for n 1 we have n D an D D i bn 2 Z 1 2L Z 1 2L L L L h f .x / cos f .x /e D L in x = L i sin n x i L dx dx: L The corresponding formulas for n way, and we discover that n n x 1 2L Z L D 0 and for n < 0 can be computed in the same f .x /e in x = L dx; for all n. (4.9) L It is important to notice that while n is the coefficient of ein x = L in the Fourier series (4.8), it is e in x = L which appears in the integral in (4.9). The series (4.8), with the coefficients computed using (4.9), is called the complex Fourier series for the function f . There are several differences between the Fourier series involving cosines and sines, given in Definition 1.20, and the Fourier series using complex exponentials presented here. First, the complex Fourier series involves a sum from n D 1 to n D 1, rather than a sum from n D 0 to n D 1. Next, for the complex Fourier series, there is one succinct formula (4.9) for the Fourier coefficients, rather than the two separate formulas for an and bn in (1.18) and (1.19). For this reason, and also because computations using exponentials are easier than those using trigonometric functions, many scientists and engineers prefer to use the complex version of the Fourier series. EXAMPLE 4.10 ◆ Find the complex Fourier series for the function f .x / D e x on the interval T 1; 1U: This is the function we examined in Examples 3.4, 3.8, and 3.10. For this function it is much easier to compute the complex Fourier coefficients than the real 742 Chapter 12 Fourier Series ones. The nth coefficient is n |αn | D D 1 Z 1 1 2 Z 1 2 1 1 ex e in x dx e.1 in / x dx 1 D 2.1 1 i n / . 1/n −10 0 10 D 2.1 n Figure 1 The coefficients of the complex Fourier series for f (x) = e x. i n / 1 in e 1Cin e .e 1=e/: The last identity follows since ein D e in D . 1/n : The magnitude of the coefficients is plotted in Figure 1. Notice that we included negative indices. The complex Fourier series is ex e 1 1=e X . 1/n in x e 2 1 i n nD 1 1x for 1: ◆ Relation between the real and complex Fourier series We derived the complex Fourier series from the real series. In doing so we found that the complex coefficients can be computed from the real coefficients using (4.7). In turn, we can solve these relationships for the real coefficients in terms of the complex coefficients, getting a0 D 20 ; an D n C n ; and bn D i .n n /; for n 1: (4.11) These equations simplify somewhat if the function f is real valued. In that case f .x / D f .x /; so n D 2L1 D 2L1 Z L L Z L f .x /e in x = L dx f .x /ein x = L d x L D 2L1 D n Z L L f .x / e in x = L dx : Consequently, if f is real valued, an D n C n D 2 Re n and bn D i .n n / D 2 Im n : EXAMPLE 4.12 ◆ Compute the coefficients of the real Fourier series for the function f .x / D e x on the interval T 1; 1U: We computed the complex coefficients in Example 4.10 and found that n D 2.1. 1/n .e i n / 1=e/: 12.5 The Discrete Fourier Transform and the FFT 743 Since the function is real valued, we can use (4.11) to find that an D 2 Re n D . bn D 2 Im n D 1/n .e 1=e/ and 1 C n2 2 . 1/nC1n .e 1=e/ : 1 C n2 2 ◆ ................ EXERCISES 1. Show that the complex Fourier coefficients for an even, real-valued function are real. Show that the complex Fourier coefficients for an odd, real-valued function are purely imaginary (i.e., their real parts are zero). In Exercises 2–11 find the complex Fourier series for the given function on the interval T ; U. 2. f .x / D x 3. f .x / D jx j 4. f .x / D 5. f .x / D ( ( 1; x < 0; 1; 0x 0; x < 0; 1; 0 x 6. f .x / D x 2 7. f .x / D ebx 8. f .x / D x 3 9. f .x / D x 10. f .x / D j cos x j 11. f .x / D j sin x j 12. Two complex valued function f and g are said to be orthogonal on the interRb val Ta ; bU if a f .x /g .x / d x D 0: Show that The functions ei px and eiq x are orthogonal on T ; U if p and q are different integers. 13. Use the P method of proof of Theorem 1.17, and Exercise 12 to show that if f .x / D n1D 1 n einx for x , then n D 21 Z f .x /e inx dx: 744 Chapter 12 Fourier Series 12.5 The Discrete Fourier Transform and the FFT Suppose that f .t / is piecewise continuous for 0 t f .t / 1 X kD 1 k eikt ; D 21 where k 2 .9 Then Z 2 f .t /e ikt dt : (5.1) 0 The Fourier coefficients k are often too difficult to compute exactly. In such a case it is useful to approximate the coefficients using a numerical integration technique such as the trapezoid rule. We remind you that for a function F defined on the interval T0; 2 U, the trapezoid R 2 rule for approximating the integral 0 F .t / dt with step size h D 2= N is Z 2 0 1 F .0/ C F .h / C F .2h / C C F .. N F .t / dt h 2 If F .t / is 2 -periodic, then F .0/ becomes Z 2 F .t / dt 0 h 1 /h / C 1 F .N h/ : 2 D F .2/ D F . N h /, and the preceding formula N 1 X j D0 F . j h/ D N 1 2 X F .2 j = N /: N j D0 Applying this formula to the integral for the Fourier coefficient in (5.1), we get k D 21 Z 2 De yj 2 i = N ikt 0 Let’s set Then w f .t /e D dt N1 N 1 X j D0 f .2 j = N / and w f .2 j = N /e 2 i j k= N : (5.2) D e 2 i = N : , and the approximation becomes k N 1 1 X y jw jk: N j D0 (5.3) The sum on the right side of equation (5.3) involves the discrete values y j D f .2 j = N /. The values of f .t / for t 6 D 2 j = N are ignored. It is a common occurrence in the digital age to replace a time dependent function with such a discrete sample of that function. For example, f .t / may represent a music signal that we want to transmit over the internet. The internet, or any other computer network, allows only discrete signals, so to transmit the music we replace the continuous signal f .t / with the discrete sample y j D f .2 j = N / for j D 0; 1; 2; : : :; N 1: In many digital applications signals arise that are not represented by a continuous function at all. Instead, they arise as discrete values y j at a discrete set of times t j . Such a signal is illustrated in Figure 1. Here, the horizontal axis represents time, which has been divided into many small time intervals. 9 In most applications of the material in this section, the function f represents a time dependent signal. Consequently, we will use t instead of x as the independent variable. 12.5 The Discrete Fourier Transform and the FFT 745 The discrete Fourier transform t Even for discrete signals such as that illustrated in Figure 1, it is often useful to consider the transform we found in equation (5.3). We will assume that the signal is an infinite sequence y D f y j j 1 < j < 1g that is periodic with period N , meaning that y N C j D y j for all j . Wherever the sequence yk comes from, the transform on the right-hand side of (5.3) is important. D f y j g be a sequence of complex numbers that is periodic with period N . The discrete Fourier transform of y is the sequence b y D fb yk g, where DEFINITION 5.4 Let y Figure 1 A discrete signal. b yk D N 1 X j D0 D y j e 2 ikj = N N X1 j D0 y j w jk; 1 < k < 1: for For the last expression in (5.5) we use the notation w e 2 i = N . An important property of w D e2 i = N is that w N follows that w N D 1. From this we see that b yk C N D N X1 j D0 yjw D j .k C N / N X1 j D0 yjw w jk jN D (5.5) D e2 i =N , so that w D D e2 i D 1: Of course, it N X1 j D0 y jw jk D byk : Thus the discrete Fourier transform is also periodic of period N . Let’s look back at equation (5.3), where we used the trapezoid rule to approximate k , the kth Fourier coefficient of the function f . Using (5.5), we can now write (5.3) as y b k k : (5.6) N It follows from the Riemann–Lebesgue lemma that k ! 0 as k ! 1. On the other hand, the sequence b yk is periodic. This implies that (5.3) is not a good approximation for large k. In fact, The trapezoid rule algorithm used to approximate the integral in (5.2) loses accuracy as the integrand f .t /eikt becomes more oscillatory as the frequency (and index) k increases. Therefore we would expect equation (5.3) to provide a good approximation only for k that are relatively small compared to N . There is another, related factor to consider. We have previously talked of the importance of the low frequency components of a function. When we use the complex Fourier series, this means that we include both k and k for small values of k. y, By (5.6) and the periodicity of the sequence b k byNk D by NN k : Therefore, when considering small frequency components while using the discrete Fourier transform, we must include both b yk and b y N k for small nonnegative values of the index k. 746 Chapter 12 Fourier Series EXAMPLE 5.7 ◆ Use the discrete Fourier transform to compute approximately the first 64 Fourier coefficients of the function f .t / D e t 2 =10 [sin 2t C 2 cos 4t C 0:4 sin t sin 10t] on the interval T0; 2 U. f(t) 2 0 0 π t 2π −2 The function f is plotted in Figure 2. Because of the terms involving sin 2t and cos 4t, we would expect that the Fourier coefficients of order 2 and 4 would be large. With N D 64; we set y j D f .2 j = N / for 0 j N 1. Then we use the fast Fourier transform function in Matlab to compute the discrete Fourier transform b y. The magnitude of the b yk is plotted in Figure 3. Indeed, the coefficients corresponding to k D 4 and k D 60 D N 4 are the largest. Notice how the coefficients with index k and N k are largest for small k. Thus the coefficients corresponding to small frequency components dominate. ◆ Now let’s look at (5.5) and restrict ourselves to k D 0; 1; : : : ; N 1. The kth equation expresses b yk as a linear combination of f y j j 0 j N 1g: These N equations can be expressed as the single matrix equation Figure 2 The function in Example 5.7. 0 b y0 B y1 B b B B b y2 B B :: : yN 1 b 1 0 1 C B C B1 C B CDB1 C C A B B :: : 1 1 w w2 :: : w2 w4 :: : 1 wN w 2. N 1 1/ 10 1 1 y0 y1 y2 B wN 1 C CB C B B w 2. N 1/ C CB :: C B :: ::: : A : . N 1/2 yN w C C C C: C C A (5.8) 1 |yˆk| It will be useful to use vector notation. We will set y D . y0 ; y1 ; : : : ; y N /T ; b y D .b y0 ; b y1 ; : : : ; b y N 1 /T : 20 0 0 32 63 k Figure 3 The discrete Fourier transform of the discretization of the function in Example 5.7. 1 and With this notation, equation (5.8) becomes b y where 0 1 B B1 B 1 F DB B B :: : D Fy; 1 1 w w2 :: : w2 w4 :: : 1 wN 1 w 2. N (5.9) 1/ 1 1 wN 1 C C C : : : w 2. N 1/ C : :: C C ::: : A . N 1/2 w (5.10) 12.5 The Discrete Fourier Transform and the FFT 747 The inverse discrete Fourier transform Equation (5.8) gives the formula for computing the discrete Fourier coefficients in terms of the original discrete signal. Many applications require the reverse operation, the computation of the original discrete signal, yk , from its discrete Fourier coefficients, b yk . Therefore, we would like to solve for the yk in equation (5.8) or, equivalently, we need to find the inverse of the matrix F in (5.10). Computing the inverse of F is somewhat difficult, so we will simply give the result. Consider the complex conjugate of F 0 1 B B1 B 1 F DB B B :: : 1 1 w w2 :: : w2 w4 :: : 1 wN w 2. N 1 1 1 wN 1 C C C w 2. N 1/ C : :: C C ::: : A . N 1/2 w 1/ Direct computation shows that FF D NI or 1 F D N1 F : The computation of F F is not too difficult. For example, when N 0 FF D 1 1 1 w w 1 w2 w 1 10 2 A 4 1 1 1 w 1 w2 1 1 D 3, w2 A : w4 An explicit computation shows that this matrix product is 3I . For example, the .2; 1/-entry of this matrix product is 1 C w C w2 since w 3 D 11 w3 w D 0; D 1: On the other hand, the .2; 2/-entry is 1 C jw j2 C jw j4 D 3: We summarize this discussion in the next theorem. THEOREM 5.11 The original signal y j , j D 0; : : : ; N 1, can be computed from its discrete Fourier transform, b yk , k D 0; : : : ; N 1, using yj D N1 N 1 X k D0 b yk w jk ; for 1 < j < 1: We can write this in matrix form as yD 1 Fb y: N (5.12) 748 Chapter 12 Fourier Series Noise filtering Practical applications of this theorem are numerous. We will mention two. The first involves filtering noise from a signal. When a signal is transmitted, it is often corrupted by interference from background radiation or other sources. The corrupted part of the signal is called noise. In many applications, the noise appears with a certain frequency range that is different from the dominant frequencies of the original signal. To filter out noise, a discrete Fourier transform of the signal is computed using (5.8). Then, the Fourier coefficients, b yk , corresponding to the noisy, undesirable frequencies are set equal to zero. The signal is then recomputed from the new Fourier coefficients using equation (5.12). Since the frequency components corresponding to the noise have been removed, the resulting signal should contain much less noise than the original. Frequently, noise occurs at relatively high frequencies. Suppose that we add the noise term N .t / D 2 sin.50t / to the function in Example 5.7. The resulting signal is g .t / D f .t / C N .t /; and it is plotted in Figure 4. It is difficult to see that the signal of interest is the function f .t / plotted in Figure 2. We set y j D g .2 j = N / for 0 j N 1, with N D 256, and take the discrete Fourier transform. The result is plotted in Figure 5. Notice the large terms at k D 50 and k D 206 D N 50: To eliminate the high frequency noise, we “zero out” the high frequency coefficients by setting b yk D 0 for 13 k N 13 D 243; and compute the inverse transform. The resulting function is plotted in blue in Figure 6, while the original function f is plotted in black. The graphical comparison shows that we have effectively recovered the wanted signal from the noisy one. The most significant difference occurs at the two endpoints. This is a result of Gibb’s phenomenon. Since f p , the periodic extension of f , is not continuous, we have to expect this. |yˆk| g(t) 2 2 0 0 0 t 2π π k 255 −2 0 Figure 4 A signal in the presence of high frequency noise. Figure 5 The discrete Fourier transform of the noisy signal. 128 0 π t 2π −2 Figure 6 The result of filtering out the high frequencies. Data compression A second application involves data compression. The goal is to store or transmit a signal using the fewest possible bits of data. One way to accomplish this is to store or transmit only the dominant Fourier coefficients of a given signal. In view of the Riemann–Lebesgue Lemma, Theorem 2.10, only a finite number of Fourier coefficients are dominant, since these coefficients get very small as the frequency 12.5 f(t) 2 0 0 π t 2π −2 Figure 7 The result of removing small coefficients. The Discrete Fourier Transform and the FFT 749 gets large. Thus, a compression routine can be implemented in a three-step process. First, we compute the discrete Fourier coefficients using equation (5.8). Then we set all of the small Fourier coefficients equal to zero, storing only the dominant Fourier coefficients. Finally, to recover the compressed signal, use equation (5.12). What constitutes “small” depends on the application and the tolerance for error. There is a trade-off between the number of Fourier coefficients that are set equal to zero and the accuracy of the compressed signal. The larger the amount of compression, the more coefficients that are set equal to zero, and the greater the difference between the compressed signal and the original signal. As an example, we set all coefficients for the function in Example 5.7 equal to 0 that were smaller than 1=10 of the largest coefficient. This resulted in 21 nonzero coefficients. Again we computed the inverse transform, and plotted the result in blue in Figure 7. The function f .t / is plotted in black. The comparison shows that there is loss, but not a great deal. The fast Fourier transform Calculating the discrete Fourier transform using equation (5.5) or (5.8) involves lots of computations. Computing each b yk using (5.5) requires the sum of N products of two numbers. We will call the combination of a multiplication and an addition a multiply-add, and we will refer to it as an MA. Thus computing each b yk requires N MAs. Computing the complete discrete Fourier transform means computing b yk for 0 k N 1: This requires N 2 MAs. The computation can be speeded up using the multiplicative nature of N . Suppose that N D pq, where the factors p and q are both bigger than 1. The index in the sum in (5.5) can be written as j D p C , where 0 q 1 and 0 p 1: In terms of and , the sum in (5.5) becomes the double sum b yk D p 1q 1 X X D0 D0 y pC w . p C/k D p 1 X q 1 X D0 D0 ! y pC w pk w k : (5.13) We will isolate the inner sum by setting b y;k D q 1 X D0 y pC w pk : (5.14) Then (5.13) becomes b yk D p 1 X D0 b y;k w k ; for 0 k N 1: (5.15) The idea is to compute b y;k first using (5.14), and then compute the Fourier transform using (5.15). The savings in the computation comes from realizing that b y;k is periodic in k with period q. To see this, we first remember that w N D 1 and N D pq. Then we have b y;kCq D q 1 X D0 y pC w p .kCq / D q 1 X D0 y pC w pk D by;k : 750 Chapter 12 Fourier Series Thus we only need to compute b y;k for 0 p 1 and 0 k q 1. Since computing each b y;k requires q MAs, computing all of them requires pq q D pq 2 D N q MAs. Now computing the N components of the Fourier transform using (5.15) requires N p additional MAs, for a total of N . p C q /. If N , p, and q are all large numbers, the sum p C q is much smaller than the product N D pq. The process outlined in the previous paragraph can be iterated if N has more factors. If N D p1 p2 : : : pn , the number of MAs required is reduced to N . p1 C p2 C C pn /. This algorithm for computing the discrete Fourier transform is called the fast Fourier transform (FFT). Clearly the FFT works best if N has a large number of very small factors, the best being when N is a power of 2. This is the most commonly used case. When N D 2 L the FFT can compute the Fourier coefficients with only about N 2L D 2N log2 N MAs. For example, if N D 210 D 1024, the FFT requires only about 20,000 MAs versus the one million or so that are required using (5.8). The savings get more impressive as N gets larger. A similar FFT routine exists for computing the inverse discrete Fourier transform. The mathematical computer programs Matlab, Mathematica, and Maple all have built-in commands for the FFT and inverse FFT. ................ EXERCISES All of these exercises are designed to be done with a mathematical computer program such as Matlab, Maple, or Mathematica. 1. Consider the function f .t / D e t 2 =10 .cos 2t C 2 sin 4t C 0:4 cos 2t cos 40t / : For what values of n would you expect the Fourier coefficients to be largest? Why? Compute the coefficients numerically through n D 50 and see if you are right. (You can use a fast Fourier transform algorithm with N D 256 to do this if you wish.) Plot the partial sum of the Fourier series of order n D 6 and compare with the plot of the original f .x /. 2. Consider the function g .t / D e t 2 =8 [cos 2t C 2 sin 4t C 0:4 cos 2t cos 10t] ; for 0 t 2: Compute numerically the partial sum of the Fourier series of order N D 25. Zero out any coefficients that have absolute value smaller than 10% of the maximum. Plot the resulting series and compare with the original function g .t /. Try experimenting with different tolerances (other than 10%). 3. Show that if y D f ym g is a sequence of real numbers that is periodic with period N and b y is the discrete Fourier transform of y, then the complex conjugate of b ym is b y N m . (As a result, when m is small relative to N , b y N m has to be considered a low frequency coefficient, since it is equal to the conjugate of b ym , which is approximately equal to the conjugate of the mth Fourier coefficient.) The next three problems require the use of the fast Fourier transform on a computer (e.g., Maple or Matlab’s FFT routine). 12.5 The Discrete Fourier Transform and the FFT 751 4. Filtering Let f .t / D e t 2 =10 .sin.2t / C 2 cos.4t / C 0:4 sin.t / sin.50t // : Discretize f by setting yk D f .2k =256/; for k D 0 : : : 255. Use the fast Fourier transform to compute b yk for 0 k 255. According to Exercise 3, the low-frequency coefficients are b y0 : : : b ym and b y256 m : : : b y255 for some low value of m. Filter out the high-frequency terms by setting b yk D 0 for m k 255 m with m D 6. Apply the inverse fast Fourier transform to this new set of b yk to compute the yk (now filtered); plot the new values of yk and compare with the original function. Experiment with other values of m. 5. Compression Let tol D 0:01. In Exercise 4, if jb yk j < tol M, where M D max0k255 jb yk j, set b yk equal to zero. Apply the inverse fast Fourier transform to this new set of b yk to compute the yk . Plot the new values of yk and compare with the original function. Experiment with other values of tol. Keep track of the percentage of Fourier coefficients that have been filtered out. Matlab’s sort command is useful for finding a value for tol in order to filter out a specified percentage of coefficients. 6. Repeat the previous two exercises over the interval 0 t f .t / D where N .t / D te t2 1 with the function 52t 4 C 100t 3 49t 2 C 2 C N .100.t C N .200.t 2=3// : 1=3//
© Copyright 2026 Paperzz