Chapter 11.02 Continuous Fourier Series ∑

advertisement
Chapter 11.02
Continuous Fourier Series
For a function with period T , a continuous Fourier series can be expressed as [1-5]
∞
f (t ) = a 0 + ∑ a k cos(kw0 t ) + bk sin( kw0 t )
(1)
k =1
The unknown Fourier coefficients a 0 , a k and bk can be computed as
T
1
a 0 =   ∫ f (t )dt
(2)
 T 0
Thus, a 0 can be interpreted as the “average” function value between the period interval
[0, T ] .
T
2
a k =   ∫ f (t ) cos(kw0 t )dt
 T 0
≡ a − k (hence a k is an “even” function)
T
2
bk =   ∫ f (t ) sin( kw0 t )dt
 T 0
≡ −b− k (hence bk is an “odd” function)
Derivation of formulas for a 0 , a k and bk
(3)
(4)
Integrating both sides of Equation 1 with respect to time, one gets
T
∫
0
T
T ∞
T ∞
0
0 k =1
0 k =1
f (t )dt = ∫ a 0 dt + ∫ ∑ a k cos(kw0 t )dt + ∫ ∑ bk sin( kw0 t )dt
(5)
The second and third terms on the right hand side of the above equations are both zeros, due
to the result stated in Equation (1) of Chapter 11.01.
Thus,
T
∫ f (t )dt = [a t ]
0
T
0
(6)
0
Hence,
= a0T
T
1
a 0 =   ∫ f (t )dt
 T 0
11.02.1
(7)
11.02.2
Chapter 11.02
Now, if both sides of Equation (1) are multiplied by sin( mw0 t ) and then integrated with
respect to time, one obtains
T
∫
0
T
T ∞
0
0 k =1
f (t ) × sin( mw0 t )dt = ∫ a 0 sin( mw0 t )dt + ∫ ∑ a k cos(kw0 t ) sin( mw0 t )dt
T ∞
(8)
+ ∫ ∑ bk sin( kw0 t ) sin( mw0 t )dt
0 k =1
Due to Equations (1) and (3) of Chapter 11.01, the first and second terms on the right hand
side (RHS) of Equation (8) are zero.
Due to Equation (4) of Chapter 11.01, the third RHS term of Equation (8) is also zero, with
the exception when k = m , which will become (by referring to Equation (2) of Chapter
11.01)
T
∫
0
T
f (t ) sin( kw0 t )dt = 0 + 0 + ∫ bk sin 2 (kw0 t )dt
(9)
0
= bk ×
Thus,
T
2
T
2
bk =   ∫ f (t ) sin( kw0 t )dt
 T 0
Similar derivation can be used to obtain a k , as shown in Equation (3)
A FORTRAN Program for finding Fourier Coefficients a 0 , a k , and bk
Based upon the derived formulas for a 0 , a k and bk (shown in Equations 2-4), a
FORTRAN/MATLAB computer program has been developed. (The program is available at
http://numericalmethods.eng.usf.edu/simulations/mtl/11fft/f_coeff_final.m)
Example 1
Using the continuous Fourier series to approximate the following periodic function ( T = 2π
seconds) shown in Figure 1.
Continuous Fourier Series
11.02.3
Figure 1 A Periodic Function (Between 0 and 2π ).
t for 0 < t ≤ π
f (t ) = 
π for π ≤ t < 2π
Specifically, find the Fourier coefficients a 0 , a1 ,...., a8 and b1 ,...,b8 .
Solution
The unknown Fourier coefficients a 0 , a k and bk can be computed based on Equations (2–4);
as following:
2π
1
a 0 =   ∫ f (t )dt
T  0
2π

π
1
a0 =
× ∫ tdt + ∫ πdt 
(2π )  0
π

a 0 = 2.35619
T = 2π
2
ak =  
T 
∫ f (t ) cos(kw t )dt
0
0
π
2π
2π 
2π  


 2  
ak = 
× t dt 
× t dt + ∫ π × cos k ×
 × ∫ t cos k ×
T
T
 



 2π   0
π
π
2π

1 
a k =   × ∫ t cos(kt )dt + ∫ π cos(kt )dt 
 π  0
π

The “integration by part” formula can be utilized to compute the first integral on the righthand-side of the above equation.
For k = 1,2,....,8, the Fourier coefficients a k can be computed as
a1 = −0.6366257003116296
a 2 = −5.070352857678721 × 10 −6 ≈ 0
a3 = −0.07074100153210318
11.02.4
Chapter 11.02
a 4 = −5.070320092569666 × 10 −6 ≈ 0
a5 = −0.025470225589332522
a 6 = −5.070265333302604 × 10 −6 ≈ 0
a 7 = −0.0012997664818977102
a8 = −5.070188612604695 × 10 −6 ≈ 0
Similarly,
2π
2
bk =   ∫ f (t ) sin(kw0 t )dt
T  0
π
2π

1 
bk =   × ∫ t sin (kt )dt + ∫ π sin (kt )dt 
 π  0
π

For k = 1,2,....,8, the Fourier coefficients bk can be computed as
b1 = −0.9999986528958207
b2 = −0.4999993232285269
b3 = −0.3333314439509194
b4 = −0.24999804122384547
b5 = −0.19999713794872364
b6 = −0.1666635603759553
b7 = −0.14285324664625462
b8 = −0.12499577981019251
Any periodic function f (t ), such as the one shown in Figure 1 can be represented by the
Fourier series as
∞
f (t ) = a 0 + ∑ {a k cos(kw0 t ) + bk sin( kw0 t )}
k =1
where a 0 , a k and bk have already been computed (for k = 1,2,....,8, );
and w0 = 2πf
2π
=
T
2π
=
2π
=1
Thus, for k = 1, one obtains
f1 (t ) ≈ a 0 + a1 cos(t ) + b1 sin(t )
For k = 1 → 2, one obtains
f 2 (t ) ≈ a 0 + a1 cos(t ) + b1 sin(t ) + a 2 cos(2t ) + b2 sin( 2t )
For k = 1 → 4, one obtains
f 4 (t ) ≈ a 0 + a1 cos(t ) + b1 sin(t ) + a 2 cos(2t ) + b2 sin( 2t ) + a3 cos(3t ) + b3 sin(3t )
+ a 4 cos(4t ) + b4 sin( 4t )
Continuous Fourier Series
11.02.5
Plots for f1 (t ), f 2 (t ) and f 4 (t ) are shown in Figure 2.
Figure 2 Fourier Approximated Functions (for Example 1).
It can be observed from Figure 2 that as more terms are included in the Fourier series, the
approximated Fourier functions are more closely resemble the original periodic function as
shown in Figure 1.
Example 2
The periodic triangular wave function f (t ) is defined as
− π
 2 for

− t for
f (t ) = 
− π
for

 2

−π < t <
−π
2
π
−π
<t<
2
2
π
2
<t <π
Find the Fourier coefficients a 0 , a1 ,..., a8 and b1 ,...,b8 and approximate the periodic
triangular wave function by the Fourier series.
11.02.6
Chapter 11.02
Figure 3 Periodic triangular wave function for Example 2.
Solution
The unknown Fourier Coefficients a 0 , a k and bk can be computed based on Equations (2-4)
as follows
π
1
a 0 =   ∫ f (t )dt
 T  −π
π
− π2

π
2
1
  π
 π 
a0 =
×
 − dt + (− t )dt + ∫  − dt 
(2π )  −∫π  2  −∫π
2 
π
2
2


a 0 = −0.78539753
π
2
a k =   ∫ f (t ) cos(kw0 t )dt
 T  −π
where
w0 =
2π
2π
=1
2π
T
=
Hence,
π
2
a k =   ∫ f (t ) cos(kt )dt
 T  −π
Continuous Fourier Series
11.02.7
or
π
− π2

π
2

 π
 2   π 
ak = 
 ∫  −  cos(kt )dt + ∫ (− t ) cos(kt )dt + ∫  −  cos(kt )dt 
2
 2π  −π  2 
π
π

−
2
2


Similarly,
π
π
2
2
bk =   ∫ f (t ) sin( kw0 t )dt =   ∫ f (t ) sin( kt )dt
 T  −π
 T −π
or,
π

− π2
π
2

 π
 2   π 
bk = 
 ∫  −  sin( kt )dt + ∫ (− t )sin( kt )dt + ∫  −  sin( kt )dt 
2
 2π  −π  2 
π
π

−
2
2


The “integration by part” formula can be utilized to compute the second integral on the righthand-side of the above equations for a k and bk .
For k = 1,2,...8, the Fourier coefficients a k and bk can be computed and summarized as
following in Table 1
Table 1 Fourier coefficients a k and bk for various k values.
k
1
2
3
4
5
6
7
8
ak
0.999997
0.00
-0.3333355
0.00
0.1999968
0.00
-0.14285873
0.00
bk
-0.63661936
-0.49999932
0.07073466
0.2499980
-0.02546389
-0.16666356
0.0126991327
0.12499578
The periodic function (shown in Example 1) can be approximated by Fourier series as
∞
f (t ) = a 0 + ∑ {a k cos(kt ) + bk sin( kt )}
k =1
Thus, for k = 1 , one obtains:
f1 (t ) = a 0 + a1 cos(t ) + b1 sin(t )
For k = 1 → 2, one obtains:
f 2 (t ) = a 0 + a1 cos(t ) + b1 sin(t ) + a 2 cos(2t ) + b2 sin( 2t )
Similarly, for k = 1 → 4, one has:
f 4 (t ) = a 0 + a1 cos(t ) + b1 sin(t ) + a 2 cos(2t ) + b2 sin( 2t ) + a3 cos(3t ) + b3 sin(3t )
+ a 4 cos(4t ) + b4 sin( 4t )
Plots for functions f1 (t ), f 2 (t ) and f 4 (t ) are shown in Figure 4.
11.02.8
Chapter 11.02
Figure 4 Fourier approximated functions for Example 2.
It can be observed from Figure 4 that as more terms are included in the Fourier series, the
approximated Fourier functions closely resemble the original periodic function.
Complex Form of the Fourier Series
Using Euler’s identity, e ix = cos( x) + i sin( x), and e − ix = cos( x) − i sin( x), the sine and cosine
can be expressed in the exponential form as
e ix − e − ix
(10)
sin ( x) =
=" odd " function, since sin ( x) = −sin (− x)
2i
e ix + e − ix
(11)
cos( x) =
=" even" function, since cos( x) = cos(− x)
2
Thus, the Fourier series (expressed in Equation 1) can be converted into the following form
∞
 e ikw0t − e − ikw0t 
 e ikw0t + e − ikw0t 
 + bk 

f (t ) = a 0 + ∑ a k 
(12)
2
2i
k =1




or
∞
b i
b i
a
a
f (t ) = a 0 + ∑ e ikw0t  k + k *  + e −ikw0t  k − k * 
 2 2i i 
 2 2i i 
k =1
or, since i 2 = −1, one obtains
∞
 a − ibk  −ikw0t  a k + ibk 
f (t ) = a 0 + ∑ e ikw0t  k
+e


2 
2 


k =1
Define the following constants
~
C0 ≡ a0
(13)
(14)
Continuous Fourier Series
~
Ck ≡
Hence:
11.02.9
a k − ibk
2
(15)
a − ib− k
~
(16)
C −k ≡ −k
2
Using the even and odd properties shown in Equations (3) and (4) respectively, Equation (16)
becomes
a + ibk
~
(17)
C −k ≡ k
2
Substituting Equations (14), (15), (17) into Equation (13), one gets
∞
∞
~
~
~
f (t ) = C 0 + ∑ C k e ikw0t + ∑ C − k e −ikw0t
k =1
~
= ∑ C k e ikw0t +
∞
k =0
∞
~
= ∑ C k e ikw0t +
=
k =0
∞
~
∑C e
k = −∞
k
k =1
−∞
~
∑C e
k = −1
−1
k
~
ikw0t
∑C e
k = −∞
k
ikw0t
ikw0t
(18)
~
The coefficient C k can be computed, by substituting Equations (3) and (4) into Equation (15)
to obtain
T
T

~  1  2 
(19)
C k =   ∫ f (t ) cos(kw0 t )dt − i ∫ f (t ) sin( kw0 t )dt 
 2  T  0
0

T

 1 
=  ∫ f (t ) × [cos(kw0 t ) − i sin( kw0 t )]dt 
 T  0

Substituting Equations (10, 11) into the above equation, one gets
T
 eikw0 t + e − ikw0 t
~  1 
eikw0 t − e − ikw0 t  
Ck =  ∫ f (t ) × 
−i×
 dt 
2
2i
 T  0

 
T

 1 
(20)
=  ∫ f (t ) × e −ikw0t dt 
 T  0

Thus, Equations (18) and (20) are the equivalent complex version of Equations (1)-(4).
References
[1] E.Oran Brigham, The Fast Fourier Transform, Prentice-Hall, Inc. (1974).
[2] S.C. Chapra, and R.P. Canale, Numerical Methods for Engineers, 4th Edition, Mc-Graw
Hill (2002).
[3] W.H . Press, B.P. Flannery, S.A. Tenkolsky, and W.T. Vetterling, Numerical Recipies,
Cambridge University Press (1989), Chapter 12.
11.02.10
Chapter 11.02
[4] M.T. Heath, Scientific Computing, Mc-Graw Hill (1997).
[5] H. Joseph Weaver, Applications of Discrete and Continuous Fourier Analysis, John
Wiley & Sons, Inc. (1983).
FAST FOURIER TRANSFORM
Topic
Continuous Fourier Series
Summary Textbook notes on continuous Fourier series
Major
General Engineering
Authors
Duc Nguyen
Date
July 25, 2010
Web Site http://numericalmethods.eng.usf.edu
Download