Chapter 4 Time-Frequenc Analsis: Fourier Transforms and Wavelets 4. Basics of Fourier Series 4.. Introduction Joseph Fourier (768-83) who gave his name to Fourier series, was not the first to use Fourier series neither did he answer all the questions about them. These series had alread been studied b Euler, d Alembert, Bernoulli and others before him. Fourier also thought wrongl that an function could be represented b Fourier series. However, these series bear his name because he studied them etensivel. The first concise stud of these series appeared in Fourier s publications in 87, 8 and 8 in his Théorie analtique de la chaleur. He applied the technique of Fourier series to solve the heat equation. He had the insight to see the power of this new method. His work set the path for techniques that continue to be developed even toda. Fourier Series, like Talor series, are special tpes of epansion of functions. With Talor series, we are interested in epanding a function in terms of the special set of functions,,, 3,... or more generall in terms of, ( a), ( a), ( a) 3,... You will remember from calculus that if a function f has a power series representation at a then f () = n= f (n) (a) n! ( a) n (4.) Remember from calculus that a series is an infinite sum. We never use the full series, we usuall truncate it. In other words, if we call S N () = ( a) n, N f (n) (a) n! n=
CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS then we approimate f () b S n (). S n () is called a partial sum. A reason for using Talor series is that their partial sums are polnomials and polnomials are the easiest functions to work with. With Fourier series, we are interested in epanding a function f in terms of the special set of functions, cos π π 3π π π, cos, cos,..., sin, sin, sin 3π,... Thus, a Fourier series epansion of a function is an epression of the form f () = A + ( A n cos nπ + B n sin nπ ) for some positive constant. Finding the Fourier series for a given function f () (if it eists) amounts to finding the coeffi cients A n for n =,,,... and B n for n =,, 3,... In this section, we will not focus on theoretical considerations such as convergence, differentiation and integration of Fourier series. We will onl define Fourier series and give a few eamples and applications. 4.. Euler s Formulas for the Coeffi cients Definition 4.. The Fourier series of a function f () on the interval [, ] where > is given b f () = A + ( A n cos nπ + B n sin nπ ) (4.) The coeffi cients which appear in the Fourier series were known to Euler before Fourier, hence the bear his name. The are given b the following formulas. To find the coeffi cients, the following formulas pla an important role:.. nπ cos d = for n =,,... nπ sin d = for n =,,... 3. nπ sin 4. nπ sin cos mπ d = for ever m, n { mπ = if m n sin d = = if m = n 5. { nπ mπ cos cos d = = if m n = if m = n We give an outline on how to find these coeffi cients. integrate this Fourier series term b term. We assume we can
4.. BASICS OF FOURIER SERIES 3 Computation of A From equation 4., if we integrate each side from to we get ( f () d = A d+ A n cos nπ ) d + B n sin nπ d Using the properties listed above, we are left with Hence, f () d = = A A = f () d A d Computation of A m for m =,,... From equation 4. we multipl each side b cos mπ d and integrate each side from to we get f () cos mπ ( d = A cos mπ d+ A n cos nπ cos mπ d + B n From the properties listed above, A cos mπ d =, nπ sin d = and nπ mπ cos cos d = for ever n m and for the value of n = m we have nπ mπ cos cos d = mπ cos cos mπ d =. Hence, we are left with Thus A m = f () cos mπ d = A m f () cos mπ d for m =,,... mπ cos Computation of B m for m =,,... We proceed in a similar manner, but we multipl each side of equation 4. b sin mπ d. Theorem 4.. The coeffi cients in equation 4. are given b A n = A = f () d (4.3) f () cos nπ d for n =,,... (4.4) sin nπ ) mπ cos d
4CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS B n = f () sin nπ d for n =,,... (4.5) Definition 4..3 For a positive integer N, we denote the N th partial sum of the Fourier series of f b S N (). So, we have S N () = A + N ( A n cos nπ We now illustrate what we did with some eamples. + B n sin nπ ) 4..3 Eamples of Fourier Series Eample 4..4 Find the Fourier series of f () = sin on [ π, π]. Using the formulas above along with equation 4., we find that A = sin d = π π B n = π A n = π π π sin cos nd = for all n sin sin nd = ecept when n = When n =,we have A =. Thus, a Fourier series of sin is sin. Of course, this was to be epected. Eample 4..5 Find the Fourier series of f () = sin on [ π, π]. Clearl, this function is π-periodic. Its graph is shown in figure 4... Computation of A. Using the formulas above along with equation 4., we find that A = π = π π sin d sin sin d since is even and sin on [, π] = π
4.. BASICS OF FOURIER SERIES 5.4...8.6.4. 8 6 4 4 6 8..4 Figure 4.: Graph of sin. Computation of A n. A n = π π 3. Computation of B n. sin cos nd = sin cos nd π = [ sin n + sin n ] d if n π = [ n + cos + ] n π cos π n + n = [ π n + ] n 4 = π (4n ) B n = sin sin nd π π = since sin sin n is odd π
6CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS 4. In conclusion sin = π + 4 π (4n cos n ) To see how this series compares to the function, we will plot some of the partial sums. et S N () = π + N 4 π (4n cos n ).4...8.6.4. 8 6 4 4 6 8..4 Figure 4.: Graph of sin and S () Eample 4..6 We now look at a π-periodic function with discontinuities and derive its Fourier series using the formulas of this section (assuming it is legitimate). This function is called the sawtooth function. It is defined b g () = { (π ) if < π g ( + π) otherwise Find the Fourier series for this function. Plot this function as well as S (), S 7 (), S () where S N () is the N th partial sum of its Fourier series. Since this function is π-periodic, we would compute its Fourier series on [ π, π] and all the integrals involved in computing the coeffi cients would be from π to π. However, in our case, f is π-periodic but described between and π. We will use theorem?? to compute the Fourier coeffi cients integrating between and π instead of between π and π.
4.. BASICS OF FOURIER SERIES 7.4...8.6.4. 8 6 4 4 6 8..4 Figure 4.3: Graph of sin and S 4 ().4...8.6.4. 8 6 4 4 6 8..4 Figure 4.4: Graph of sin and S ()
8CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS. Computation of A.. Computation of A n. A n = π = π = π A = π = 4π = g () d (π ) d g () cos nd for n =,,... [ π (π ) cos nd cos nd ] cos nd The first integral is. The second can be evaluated b parts. cos nd = n sin n π n = π n cos n = sin nd so A n = 3. Computation of B n. B n = π = π = π g () sin nd for n =,,... [ π (π ) sin nd sin nd ] sin nd The first integral is. The second can be done b parts. sin nd = π cos n n + cos nd n = π n + π sin n n = π n
4.. BASICS OF FOURIER SERIES 9 Therefore B n = [ π ] π n = n 4. Conclusion. The Fourier series of the sawtooth function is g () = sin n n Below, we show the graphs of S (), S 7 (), S (). 4 3 6 4 4 6 8 3 4 Graph of the sawtooth function (black) and S () (red)
3CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS 4 3 6 4 4 6 8 3 4 Graph of the sawtooth function (black) and S 7 () (red) 4 3 6 4 4 6 8 3 4 Graph of the sawtooth function (black) and S () (red) Remark 4..7 Several important facts are worth noticing here.. The Fourier series seems to agree with the function, ecept at the points of discontinuit.
4.. BASICS OF FOURIER SERIES 3. At the points of discontinuit, the series converges to, which is the average value of the function from the left and from the right. 3. Near the points of discontinuit, the Fourier series overshoots its limiting values. This is a well known phenomenon, known as Gibbs phenomenon. To see a simulation of this phenomenon, visit the?? 4..4 Piecewise Continuous and Piecewise Smooth Functions After defining some useful concepts, we give a suffi cient condition for a function to have a Fourier series representation. Notation 4..8 We will denote f (c ) = lim f () and f (c+) = lim f () c c + Remembering that a function f is continuous at c if and onl if lim c f () = f (c), we see that a function f is continuous at c if and onl if f (c ) = f (c+) = f (c) Definition 4..9 (Piecewise Continuous) A function f is said to be piecewise continuous on the interval [a, b] if the following are satisfied:. f (a+) and f (b ) eist.. f is defined and continuous on (a, b) ecept possibl at a finite number of points in (a, b) where the left and right limit at these points eist. Such points are called jump discontinuities. Definition 4.. (Piecewise Smooth) A function f, defined on [a, b] is said to be piecewise smooth on [a, b] if both f and f are piecewise continuous on [a, b]. Eample 4.. The sawtooth function is piecewise smooth. Eample 4.. A simple eample of a function which is not piecewise smooth is 3 for. Its derivative does not eist at, neither do the one sided limits of its derivative at. Eample 4..3 The function f () = is not piecewise continuous on [, ] since it is not continuous at and lim f () does not eist. Definition 4..4 The average of f at c is defined to be f (c ) + f (c+) Clearl, if f is continuous at c, then its average at c is f (c). We are now read to state a fundamental result in the theor of Fourier series.
3CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS Theorem 4..5 Suppose that f is a piecewise smooth function on [, ]. Then, for all in [, ], we have f ( ) + f (+) = A + ( A n cos nπ + B n sin nπ ) (4.6) f ( ) + f (+) that is the Fourier series converges to, where the coeffi cients are given b equations 4.3, 4.4, and 4.5. In particular, if f is piecewise smooth and continuous at, then f () = A + ( A n cos nπ that is the Fourier series converges to f (). + B n sin nπ ) (4.7) Thus, at points where f is continuous, the Fourier series converges to the function. At points of discontinuit, the series converges to the average of the function at these points. This was the case in the eample with the sawtooth function. Remark 4..6 In the case f is -periodic, we have an even stronger result. Convergence of the Fourier series is for ever, not just for ever in [, ]. We do one more eample. Eample 4..7 (Triangular Wave) The π-periodic triangular wave is given on the interval [ π, π] b { π + if π h () = π if π. Find its Fourier series.. Plot h () as well as some partial sums of its Fourier series. 3. Show how this series could be used to approimate π ( actuall π ). Solution 4..8. We begin b plotting h ()We see the function is piecewise smooth and continuous for all. Computation of A. A = π = π π = π π h () d
4.. BASICS OF FOURIER SERIES 33 5 4 3 8 7 6 5 4 3 3 4 5 6 7 8 Figure 4.5: Plot of the triangular wave Computation of A n. A n = h () cos nd π π = [ (π + ) cos nd + π π ] (π ) cos nd = (π ) cos nd replacing b in the first integral π = [ π π sin n π n + ] sin nd n = [ π] cos n π n = [ ] cos nπ + π n n = [ ] π n ( )n n { if n even = 4 πn if n odd
34CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS Computation of B n. B n = π π h () sin nd = since the integrand is odd (wh?) Conclusion. h () = π + 4 π n= cos (n + ) (n + ). et S N () = π + 4 π N n= cos (n + ) (n + ). We plot S (), S 5 () 5 4 3 8 7 6 5 4 3 3 4 5 6 7 8 Figure 4.6: Plot of the triangular wave and S () 3. From h () = π + 4 π n= cos (n + ) (n + ), if we let = then h () = h () =
4.. BASICS OF FOURIER SERIES 35 5 4 3 8 7 6 5 4 3 3 4 5 6 7 8 Figure 4.7: Plot of the triangular wave and S 5 () π, hence we get F (, ) = π + π = π + 4 π π π 8 = 4 π = n= This allows us to approimate π. n= 4 π(4n ) cos n n= (n + ) (n + ) (n + ) = + 3 + 5 + 7 +... 4..5 Fourier Series of Even and Odd Functions We finish this section b noticing that in the special cases that f is either even or odd, the series simplifies greatl. If f is even, then nπ f () sin is odd so that B n = and the series is simpl a cosine series. Similarl, if f is odd, then nπ f () cos is odd and A n = and the series is simpl a sine series. We summarize this in a theorem.
36CHAPTER 4. TIME-FREQUENCY ANAYSIS: FOURIER TRANSFORMS AND WAVEETS Theorem 4..9 Suppose that on [, ] f has the Fourier series representation [ f () = A + A n cos nπ + B n sin nπ ] Then:. If f is even then B n = for all n and in this case f () = A + A n cos nπ. If f is odd then A n = for all n and in this case f () = B n sin nπ 4..6 Fourier Series in Comple Form Recall Euler s identit e ±i = cos ± i sin (4.8) The Fourier series of a function f on [, ] can be written where f () = n= C n e inπ (4.9) C n = f () e inπ d (4.) 4..7 Some Applications Fourier series are found in the following applications:. One of the main uses of Fourier series is in solving some of the differential equations from mathematical phsics such as the wave equation or the heat equation. Fourier developed his theor b working on the heat equation.. Fourier series also have applications in music snthesis and image processing (signal processing). When we represent a signal f (t) b its Fourier [ series f (t) = A + A n cos nπt + B n sin nπt ], we are finding the con- tribution of each frequenc nπ to the signal. The value of the corresponding coeffi cients give us that contribution. The n th term of the partial sum of the Fourier series, A n cos nπt + B n sin nπt, is called the nth harmonic of f. Its amplitude is given b A n + B n.
4.. BASICS OF FOURIER SERIES 37 3. Conversel, we can create a signal b using the Fourier series A + [ A n cos nπt for a given value of and plaing with the value of the coeffi cients. Audio signals describe air pressure variations captured b our ears and perceived as sounds. We will focus here on periodic audio signals also known as tones. Such signals can be represented b Fourier series. A pure tone can be written as (t) = a cos (ωt + φ) where a > is the amplitude, ω > is the frequenc in radians/seconds and φ is the phase angle. An alternative wa to represent the frequenc is in Hertz. The frequenc f in Hertz is given b f = ω π. The pitch of a pure tone is logarithmicall related to the frequenc. An octave is a frequenc range between f and f for a given frequenc f in Hertz. Tones separated b an octave are perceived b our ears to be ver similar. In western music, an octave is divided into notes equall spaced on the logarithmic scale. The ordering of notes in the octave beginning at the frequenc Hz are shown below + B n sin nπt ] Note A A# B C C# D D# E F F# G G# A Frequenc (Hz) 33 47 6 77 94 3 33 349 37 39 44 44 A more complicated tone can be represented b a Fourier series of the form (t) = a cos (ωt + φ ) + a cos (ωt + φ ) +...