07 periodic functions and fourier series

679 views

Published on

engineering maths

Published in: Education, Business, Technology
  • Be the first to comment

  • Be the first to like this

07 periodic functions and fourier series

  1. 1. Periodic Functions and Fourier Series
  2. 2. Periodic Functions A function f ( θ ) is periodic if it is defined for all real θ and if there is some positive number, T such that f (θ + T ) = f (θ ) .
  3. 3. Fourier Series f (θ ) be a periodic function with period 2π The function can be represented by a trigonometric series as: ∞ ∞ n =1 n =1 f ( θ ) = a0 + ∑ an cos nθ + ∑ bn sin nθ
  4. 4. ∞ ∞ n =1 n =1 f ( θ ) = a0 + ∑ an cos nθ + ∑ bn sin nθ What kind of trigonometric (series) functions are we talking about? cos θ , cos 2θ , cos 3θ  and sin θ , sin 2θ , sin 3θ 
  5. 5. We want to determine the coefficients, an and bn . Let us first remember some useful integrations.
  6. 6. π ∫ π cos nθ cos mθ dθ − 1 π 1 π = ∫ cos( n + m ) θ dθ + ∫ cos( n − m ) θ dθ 2 −π 2 −π ∫ π cos nθ cos m θdθ = 0 −π ∫ π cos nθ cos m θdθ = π −π n≠m n=m
  7. 7. π ∫ π sin nθ cos mθ dθ − 1 π 1 π = ∫ sin( n + m ) θ dθ + ∫ sin( n − m ) θ dθ 2 −π 2 −π ∫ π sin nθ cos m θdθ = 0 −π for all values of m.
  8. 8. π ∫ π sin nθ sin mθ dθ − 1 π 1 π = ∫ cos( n − m )θ dθ − ∫ cos( n + m )θ dθ 2 −π 2 −π ∫ π sin nθ sin m θdθ = 0 −π ∫ π sin nθ sin m θdθ = π −π n≠m n=m
  9. 9. Determine a0 Integrate both sides of (1) from −π to π π ∫ π f ( θ ) dθ −   = ∫ a0 + ∑ an cos nθ + ∑ bn sin nθ  dθ −π n =1 n =1   π ∞ ∞
  10. 10. π ∫ π f ( θ ) dθ −   = ∫ a0dθ + ∫  ∑ an cos nθ  dθ  −π −π   n =1  π ∞ π   + ∫  ∑ bn sin nθ  dθ  −π   n =1  π π ∫π − ∞ π f ( θ ) dθ = ∫ a 0 dθ + 0 + 0 −π
  11. 11. ∫ π f ( θ) dθ = 2πa0 + 0 + 0 −π 1 a0 = 2π a0 ∫ π f ( θ ) dθ −π is the average (dc) value of the function, f (θ ) .
  12. 12. You may integrate both sides of (1) from 0 ∫ to 2π instead. f ( θ ) dθ 0 =∫ 2π 2π 0 ∞ ∞   a0 + ∑ an cos nθ + ∑ bn sin nθ  dθ n =1 n =1   It is alright as long as the integration is performed over one period.
  13. 13. ∫ 2π f ( θ ) dθ 0 2π 2π 0 0 = ∫ a0dθ + ∫ +∫ 2π 0 ∫ 2π 0    ∑ an cos nθ  dθ    n =1  ∞    ∑ bn sin nθ  dθ    n =1  ∞ 2π f ( θ ) dθ = ∫ a0dθ + 0 + 0 0
  14. 14. ∫ 2π 0 f ( θ ) dθ = 2πa0 + 0 + 0 1 a0 = 2π ∫ 2π 0 f ( θ ) dθ
  15. 15. Determine Multiply (1) by an cos mθ and then Integrate both sides from −π to π π ∫ π f ( θ ) cos mθ dθ − ∞ ∞   = ∫  a0 + ∑ an cos nθ + ∑ bn sin nθ  cos mθ dθ −π n =1 n =1   π
  16. 16. Let us do the integration on the right-hand-side one term at a time. First term, ∫ π a0 cos m θ dθ = 0 −π Second term, π ∞ ∑ a cos nθ cos mθ dθ ∫ − π n =1 n
  17. 17. Second term, π ∞ ∑a ∫π − n cos nθ cos mθ dθ = amπ n=1 Third term, π ∞ ∫ π ∑b − n =1 n sin nθ cos m θ dθ = 0
  18. 18. Therefore, π ∫ π f (θ ) cos mθ dθ = a π m − 1 am = π π ∫π − f ( θ ) cos mθ dθ m = 1, 2, 
  19. 19. Determine Multiply (1) by bn sin m θ and then Integrate both sides from −π to π π ∫ π f (θ ) sin mθ dθ − ∞ ∞   = ∫ a0 + ∑ a n cos nθ + ∑ bn sin nθ  sin m θ dθ −π n =1 n =1   π
  20. 20. Let us do the integration on the right-hand-side one term at a time. First term, π ∫πa − 0 sin m θ dθ = 0 Second term, π ∞ ∑a ∫π − n =1 n cos nθ sin m θ dθ
  21. 21. Second term, π ∞ ∑a ∫π − n =1 n cos nθ sin m θ dθ = 0 Third term, π ∞ ∑b ∫π − n n =1 sin nθ sin mθ dθ = bmπ
  22. 22. Therefore, π ∫π − f ( θ ) sin m θdθ = bmπ 1 bm = π π ∫ π f (θ ) sin mθdθ − m = 1, 2 ,
  23. 23. The coefficients are: 1 a0 = 2π ∫ 1 am = π π 1 bm = π π f ( θ ) dθ −π ∫π f ( θ ) cos mθ dθ m = 1, 2,  π f ( θ ) sin mθ dθ m = 1, 2,  − ∫π −
  24. 24. We can write n in place of m: 1 a0 = 2π 1 an = π 1 bn = π π ∫ ∫π − π π f ( θ ) dθ −π f ( θ ) cos nθ dθ ∫ π f (θ ) sin nθ dθ − n = 1 , 2 , n = 1 , 2 ,
  25. 25. The integrations can be performed from 0 2π to 1 a0 = 2π 1 an = π 1 bn = π ∫ 2π 0 ∫ 2π ∫ 2π 0 0 instead. f ( θ ) dθ f ( θ ) cos nθ dθ f ( θ ) sin nθ dθ n = 1 , 2 , n = 1 , 2 ,
  26. 26. Example 1. Find the Fourier series of the following periodic function. f ( θ) = A = −A when 0 < θ < π when f ( θ + 2π ) = f ( θ ) π < θ < 2π
  27. 27. 1 2π a0 = f ( θ ) dθ ∫0 2π 2π 1  π  = f ( θ ) dθ + ∫ f ( θ ) dθ  ∫0  π  2π  2π 1  π  = ∫0 A dθ + ∫π − A dθ    2π  =0
  28. 28. 1 2π a n = ∫ f ( θ ) cos nθ dθ π 0 2π 1 π = A cos nθ dθ + ∫ ( − A) cos nθ dθ   π   π  ∫0 1 = π π 2π 1 sin nθ   sin nθ   A n  + π − A n  = 0  0  π
  29. 29. 1 2π bn = ∫ f ( θ ) sin nθ dθ π 0 2π 1 π = A sin nθ dθ + ∫ ( − A) sin nθ dθ   π   π  ∫0 π 2π cos nθ  1  cos nθ   − A n  + π  A n   0  π A [ − cos nπ + cos 0 + cos 2nπ − cos nπ ] = nπ 1 = π
  30. 30. A [ − cos nπ + cos 0 + cos 2nπ − cos nπ ] bn = nπ A [1 + 1 + 1 + 1] = nπ 4A = when n is odd nπ
  31. 31. A [ − cos nπ + cos 0 + cos 2nπ − cos nπ ] bn = nπ A [ − 1 + 1 + 1 − 1] = nπ = 0 when n is even
  32. 32. Therefore, the corresponding Fourier series is 4A  1 1 1   sin θ + sin 3θ + sin 5θ + sin 7θ +  π  3 5 7  In writing the Fourier series we may not be able to consider infinite number of terms for practical reasons. The question therefore, is – how many terms to consider?
  33. 33. When we consider 4 terms as shown in the previous slide, the function looks like the following. 1.5 1 0.5 f(θ) 0 0.5 1 1.5 θ
  34. 34. When we consider 6 terms, the function looks like the following. 1.5 1 0.5 f(θ) 0 0.5 1 1.5 θ
  35. 35. When we consider 8 terms, the function looks like the following. 1.5 1 0.5 f( θ) 0 0.5 1 1.5 θ
  36. 36. When we consider 12 terms, the function looks like the following. 1.5 1 0.5 f(θ) 0 0.5 1 1.5 θ
  37. 37. The red curve was drawn with 12 terms and the blue curve was drawn with 4 terms. 1.5 1 0.5 0 0.5 1 1.5 θ
  38. 38. The red curve was drawn with 12 terms and the blue curve was drawn with 4 terms. 1.5 1 0.5 0 0.5 1 1.5 0 2 4 6 θ 8 10
  39. 39. The red curve was drawn with 20 terms and the blue curve was drawn with 4 terms. 1.5 1 0.5 0 0.5 1 1.5 0 2 4 6 θ 8 10
  40. 40. Even and Odd Functions (We are not talking about even or odd numbers.)
  41. 41. Even Functions Mathematically speaking - f ( − θ ) = f (θ ) The value of the function would be the same when we walk equal distances along the X-axis in opposite directions.
  42. 42. Odd Functions Mathematically speaking - f ( − θ ) = − f (θ ) The value of the function would change its sign but with the same magnitude when we walk equal distances along the X-axis in opposite directions.
  43. 43. Even functions can solely be represented by cosine waves because, cosine waves are even functions. A sum of even functions is another even function. 5 0 5 10 0 θ 10
  44. 44. Odd functions can solely be represented by sine waves because, sine waves are odd functions. A sum of odd functions is another odd function. 5 0 5 10 0 θ 10
  45. 45. The Fourier series of an even function f ( θ ) is expressed in terms of a cosine series. ∞ f ( θ ) = a0 + ∑ an cos nθ n =1 The Fourier series of an odd function f ( θ ) is expressed in terms of a sine series. ∞ f ( θ ) = ∑ bn sin nθ n =1
  46. 46. Example 2. Find the Fourier series of the following periodic function. f ( x) = x 2 when − π ≤ x ≤ π f ( θ + 2π ) = f ( θ )
  47. 47. 1 a0 = 2π 1 f ( x ) dx = 2π π ∫π − x =π 1 x  π = = 3 2π   x = −π 3 3 2 π ∫π − 2 x dx
  48. 48. 1 π an = ∫ f ( x ) cos nx dx π −π 1 π 2  = x cos nxdx  ∫−π   π Use integration by parts. Details are shown in your class note.
  49. 49. 4 an = 2 cos nπ n 4 an = − 2 n 4 an = 2 n when n is odd when n is even
  50. 50. This is an even function. Therefore, bn = 0 The corresponding Fourier series is π cos 2 x cos 3 x cos 4 x   − 4 cos x − + − +  2 2 2 3 2 3 4   2
  51. 51. Functions Having Arbitrary Period Assume that a function has period, . We can relate angle ( ) with time ( ) in the following manner. θ = ωt ω is the angular velocity in radians per second.
  52. 52. ω = 2π f f is the frequency of the periodic function, f (t) θ = 2π f t Therefore, where 2π θ= t T 1 f = T
  53. 53. 2π θ= t T 2π dθ = dt T Now change the limits of integration. θ = −π 2π −π = t T T t=− 2 θ =π 2π π= t T T t= 2
  54. 54. 1 a0 = 2π 1 a0 = T ∫ π f ( θ ) dθ −π T 2 ∫ f ( t ) dt T − 2
  55. 55. 1 an = π 2 an = T π ∫ π f (θ ) cos nθ dθ − T 2  2π n  ∫ Tf ( t ) cos T t dt   − 2 n = 1 , 2 , n = 1, 2, 
  56. 56. 1 bn = π 2 bn = T π f ( θ ) sin nθ dθ n = 1 , 2 ,  2π n  f ( t ) sin t dt ∫T  T  − n = 1, 2,  ∫π − T 2 2
  57. 57. Example 4. Find the Fourier series of the following periodic function. T T f ( t ) = t when − ≤ t ≤ 4 4 T T 3T = −t + when ≤t ≤ 2 4 4
  58. 58. f (t +T ) = f (t) This is an odd function. Therefore, T 2  2πn  bn = ∫ f ( t ) sin t dt T 0  T  4 = T ∫ 0 T 2  2πn  f ( t ) sin t dt  T  an = 0
  59. 59. 4 bn = T 4 + T T 4  2πn  t sin t  dt ∫ T  0 T 2 T   2πn   t dt  − t +  sin ∫T  2  T  4 Use integration by parts.
  60. 60.   T   nπ  sin  2.  2   2πn   2T  nπ  = 2 2 sin  nπ  2  4 bn = T bn = 0 2 when n is even.    
  61. 61. Therefore, the Fourier series is 2T π2   2π  1   6π  1  10π   sin T t  − 2 sin T t  + 2 sin T t  −   3   5     
  62. 62. The Complex Form of Fourier Series ∞ ∞ n =1 n =1 f ( θ ) = a0 + ∑ an cos nθ + ∑ bn sin nθ Let us utilize the Euler formulae. jθ − jθ cos θ = sin θ = +e 2 e e jθ −e 2i − jθ
  63. 63. n th harmonic component of (1) can be The expressed as: an cos nθ + bn sin nθ = an = an e jnθ e jnθ +e 2 − jnθ +e 2 − jnθ + bn e − ibn jnθ e −e 2i jnθ − jnθ −e 2 − jnθ
  64. 64. an cos nθ + bn sin nθ  an − jbn  jnθ  an + jbn  − jnθ = e +  e 2  2    Denoting  a n − jb n cn =   2  and c0 = a0     , c−n  a n + jbn  =  2  
  65. 65. a n cos nθ + bn sin nθ = cne jnθ + c− n e − jnθ
  66. 66. The Fourier series for can be expressed as: ∞ ( f (θ ) f ( θ ) = c0 + ∑ c n e n =1 = ∞ ∑c e n n= −∞ jnθ jnθ + c− ne − jnθ )
  67. 67. The coefficients can be evaluated in the following manner.  an − jbn  cn =   2   1 π j = ∫−π f ( θ ) cos nθdθ − 2π 2π 1 = 2π 1 = 2π π π ∫ π f ( θ ) sin nθ dθ − ∫ π f (θ )( cos nθ − j sin nθ ) dθ − π ∫π − f (θ ) e − jnθ dθ
  68. 68.  an + jbn  c− n =   2   1 π j = ∫−π f ( θ ) cos nθdθ + 2π 2π 1 = 2π 1 = 2π π ∫π − π ∫π − π ∫ π f (θ ) sin nθ dθ − f ( θ )( cos nθ + j sin nθ ) dθ f (θ ) e jnθ dθ
  69. 69.  an − jbn  cn =   2   Note that cn . c−n is the complex conjugate of Hence we may write that 1 cn = 2π . c− n  an + jbn  =  2   ∫ π f ( θ) e −π − jnθ dθ n = 0 , ± 1, ± 2 , 
  70. 70. The complex form of the Fourier series of f ( θ ) with period f (θ ) = 2π ∞ ∑c e n = −∞ n is: jnθ
  71. 71. Example 1. Find the Fourier series of the following periodic function. f ( θ) = A = −A when 0 < θ < π when f ( θ + 2π ) = f ( θ ) π < θ < 2π
  72. 72. A := 5 f ( x) := A if 0 ≤ x < π −A if π ≤ x ≤ 2 ⋅π 0 otherwise 2π 1 ⌠ A0 := ⋅ f ( x) dx 2π ⌡0 A0 = 0
  73. 73. n := 1 .. 8 2π 1 ⌠ An := ⋅ f ( x) ⋅cos ( n⋅x) dx π ⌡0 A1 = 0 A2 = 0 A3 = 0 A4 = 0 A5 = 0 A6 = 0 A7 = 0 A8 = 0
  74. 74. 2π 1 ⌠ Bn : ⋅ =  f ( x) ⋅ ( n⋅) d s i n x x ⌡ π0 B1 = 6.366 B2 = 0 B3 = 2.122 B4 = 0 B5 = 1.273 B6 = 0 B7 = 0.909 B8 = 0
  75. 75. f ( θ) = ∞ ∑ cn e jnθ n = −∞ 1 cn = 2π ∫ π f ( θ) e −π n = 0, ± 1, ± 2,  2π 1 ⌠ −n⋅ 1⋅x i C(n) : = ⋅ f (x) ⋅  e d x ⌡ 2π 0 − jn θ dθ
  76. 76. 2π 1 ⌠ −n⋅ 1⋅x i C(n) : = ⋅ f (x) ⋅  e d x ⌡ 2π 0 C ( 0) = 0 C ( 1) = − 3.183i C ( 2) = 0 C ( 3) = − 1.061i C ( 4) = 0 C ( 5) = − 0.637i C ( 6) = 0 C ( 7) = − 0.455i C ( − 1) = 3.183i C ( − 2) = 0 C ( − 3) = 1.061i C ( − 5) = 0.637i C ( − 6) = 0 C ( − 7) = 0.455i C ( − 4) = 0

×