Fourier Series
Ching-Han Hsu
© 2012, Ching-Han Hsu, Ph.D. Periodic Function
• A function f(x) is called periodic, if it is defined for every x in the domain of f and if there is some positive number p such that f(x+p)= f(x) • The number p is called a period of f(x). • If a periodic function f has a smallest period p, this is often called the fundamental period of f(x).
© 2012, Ching-Han Hsu, Ph.D. Periodic Function f(x)
x p
© 2012, Ching-Han Hsu, Ph.D. Periodic Function
• For any integer n, f(x+np) = f(x), for all x • If f(x) and g(x) have period p, then so does h(x) = af(x) + bg(x), a and b are constants.
© 2012, Ching-Han Hsu, Ph.D. Trigonometric Functions
• Consider the following periodic functions with period 2π: 1, sin x, cos x, sin2x, cos2x, …, sin nx, cos nx, …
© 2012, Ching-Han Hsu, Ph.D. Trigonometric Series • The trigonometric series is of the form a0 1 a1 cos x b1 sin x a2 cos 2x b2 sin 2x a0 1 an cos nx bn sin nx n1
a0, a1, a2, a3, …, b1, b2, b3, … are real constants and are called the coefficients of the series. • If the series converges, its sum will be a function of period 2π. © 2012, Ching-Han Hsu, Ph.D. Fourier Series
• Assume f(x) is a periodic function of period 2π that can be represented by the trigonometric series: f x a0 1 an cosnxbn sin nx n1 That is, we assume that the series converges and has f(x) as its sum. • Question: how to compute the coefficients?
© 2012, Ching-Han Hsu, Ph.D. Properties of Trigonometric Functions • Recall some basic properties of trigonometric functions cos nxdx 1cos nxdx 0 sin nxdx 1sin nxdx 0
cos mx sin nxdx 1 1 sinn mxdx sinn mxdx 0 2 2 © 2012, Ching-Han Hsu, Ph.D. Properties of Trigonometric Functions
sin mx sin nxdx 1 1 n m cosn mxdx cosn mxdx 2 2 0 n m
cos mx cos nxdx 1 1 n m cosn mxdx cosn mxdx 2 2 0 n m
© 2012, Ching-Han Hsu, Ph.D. Determination of the Constant
Term a0 • Integrating both sides from – to :
f xdx a0 an cos nx bn sin nxdx n1
2a0
1 a0 f xdx 2
© 2012, Ching-Han Hsu, Ph.D. Determination of the Coefficients an of the Cosine Term • Multiply by cosmx with fixed positive integer and then integrate both sides from – to : f xcos mxdx a0 an cos nx bn sin nx cos mxdx n1
am 1 am f xcosmxdx © 2012, Ching-Han Hsu, Ph.D. Determination of the Coefficients bn of the Sine Term • Multiply by sinmx with fixed positive integer and then integrate both sides from – to : f xsin mxdx a0 an cos nx bn sin nx sin mxdx n1
bm 1 bm f xsin mxdx © 2012, Ching-Han Hsu, Ph.D. Summary f x a0 an cosnxbn sin nx n1 1 a0 f xdx 2 1 an f xcosnxdx 1 bn f xsin nxdx
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Square Wave
• Ex. Find the Fourier coefficients of the periodic function f(x) k x 0 f x , f x 2 f x k 0 x
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Square Wave 1 1 0 a0 f xdx kdx kdx 2 2 0 1 k k 0 2 Q: Is f(x) even or odd?! 1 an f xcos nxdx 1 0 k cos nxdx k cos nxdx 0 1 k 0 k sin nx sin nx 0 n n 0 © 2012, Ching-Han Hsu, Ph.D. 1 bn f xsin nxdx 1 0 k sin nxdx k sin nxdx 0 1 k 0 k cos nx cos nx n n 0 cos n cosn 1 k k 1 cos n cos n 1 n n 2k 2 n 1,3, 1 cos n 1 cos n 0 n 2,4, n © 2012, Ching-Han Hsu, Ph.D. Fourier Series: Square Wave 4k 4k 4k b ,b 0,b ,b 0,b , 1 2 3 3 4 5 5 f (x) a0 an cos nx bn sin nx n1 2k 1 cos n sin nx n1 n 4k 1 1 sin x sin 3x sin 5x 3 5
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Square Wave
• Consider the series expansion of finite sine terms: 4k S sin x 1 4k 1 S2 sin x sin 3x 3 4k 1 1 S3 sin x sin 3x sin 5x 3 5 © 2012, Ching-Han Hsu, Ph.D. © 2012, Ching-Han Hsu, Ph.D. Representation by Fourier Series
• Thm. If a periodic function f(x) with period 2 is peicewise continuous in the interval -≦x≦ and has a left-hand derivative and right-hand derivative at each point of that interval, then Fourier series of f(x) is convergent. Its sum is f(x), except at a
point of x0 at which f(x) is discontinuous and the sum of the series is the average of
the left- and right-hand limits of f(x) at x0.
© 2012, Ching-Han Hsu, Ph.D. Representation by Fourier Series 1 f 1 0 f 1 0 2
© 2012, Ching-Han Hsu, Ph.D. Functions of Any Period p=2L
• A function f(x) of period p=2L has a Fourier series 2 2 f x a0 an cos nx bn sin nx n1 2L 2L n n a0 an cos x bn sin x n1 L L 1 L a0 f xdx n 1,2,3, 2L L 1 L nx 1 L nx an f xcos dx bn f xsin dx L L L L L © 2012, Ching-HanL Hsu, Ph.D. Fourier Series: Periodic Square Wave • Ex. Find the Fourier series of the function 0 2 x 1 f x k 1 x 1 , p 2L 4, L 2 0 1 x 2
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Periodic Square Wave
1 2 1 1 k a0 f xdx kdx 4 2 4 1 2
1 2 nx 1 1 nx an f xcos dx k cos dx 2 2 2 2 1 2 k n 1 2k n sin x sin n 2 1 n 2
2k 2k a , n 1,5,9, a , n 3,7,11, n n n n
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Periodic Square Wave
1 2 nx 1 1 nx bn f xsin dx k sin dx 2 2 2 2 1 2 k n 1 k n k n cos x cos cos n 2 1 n 2 n 2 k n k n cos cos 0 n 2 n 2
k 2k 1 3 1 5 f (x) cos x cos x cos x 2 2 3 2 5 2
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Periodic Square Wave
k=5
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Half-wave Rectifier • Ex. A sinusoidal voltage Esinwt, is passed through a half-wave rectifier that clips the negative portion of the wave. Find the Fourier series of the resulting periodic function: 0 L t 0 2 ut , p 2L , L E sin wt 0 t L w w
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Half-wave Rectifier
w w w w bn utsin nwtdt E sin wt sin nwtdt 0 w Ew w cos1 nwt cos1 nwtdt 2 0 Ew sin1 nwt sin1 nwt w 2 1 n w 1 n w 0 E sin1 n sin1 n 2 1 n 1 n E n 1 sin1 n cos1 n lim lim 2 n1 1 n n1 1 0 n 2,3,4, d sin1 n cos1 n dn © 2012, Ching-Han Hsu, Ph.D. Fourier Series: Half -wave Rectifier w w w w a0 utdt E sin wtdt 0 2 w 2 E w E E coswt cos cos0 2 0 2 w w w w an utcos nwtdt E sin wt cos nwtdt 0 w Ew w sin1 nwt sin1 nwtdt 2 0 Ew cos1 nwt cos1 nwt w 2 1 nw 1 nw 0 © 2012, Ching-Han Hsu, Ph.D. Fourier Series: Half-wave Rectifier E 1 cos1 n 1 cos1 n an 2 1 n 1 n 0 n 1,3,5, E 2 2 n 2,4,6, 2 1 n 1 n 0 n 1,3,5, 2E n 2,4,6, n 1n 1 E E 2E 1 1 ut sin wt cos2wt cos4wt 2 13 35 © 2012, Ching-Han Hsu, Ph.D. Fourier Series: Half-wave Rectifier k=5 =1
© 2012, Ching-Han Hsu, Ph.D. Even and Odd Functions
• A function e(x) is even, if e(-x)=e(x). • A function o(x) is odd, if o(-x)=-o(x).
ex ox
© 2012, Ching-Han Hsu, Ph.D. Even and Odd Functions: Facts • If e(x) is an even function, then
L L exdx 2 exdx L 0 • If o(x) is an odd function, then L oxdx 0 L
• The product of an even and an odd function is odd e xo x exox
© 2012, Ching-Han Hsu, Ph.D. Fourier Cosine Series
• Thm. The Fourier series of an even function of period 2L is a Fourier cosine series n f x a0 an cos x n1 L with coefficients 1 L 1 L a0 f xdx f xdx 2L L L 0 1 L nx 2 L nx an f xcos dx f xcos dx L L L L 0 L © 2012, Ching-Han Hsu, Ph.D. Fourier Sine Series
• Thm. The Fourier series of an odd function of period 2L is a Fourier sine series n f x bn sin x n1 L with coefficients
1 L nx 2 L nx bn f xsin dx f xsin dx L L L L 0 L
© 2012, Ching-Han Hsu, Ph.D. Fourier Series: Sum of Functions
• Thm. The Fourier coefficients of a sum
f1+f2 are the sums of the corresponding Fourier coefficients of f1 and f2.
© 2012, Ching-Han Hsu, Ph.D. 4k 1 1 f (x) sin x sin 3x sin 5x 3 5 4k 1 1 f * (x) k sin x sin 3x sin 5x 3 5
© 2012, Ching-Han Hsu, Ph.D. Sawtooth Wave • Ex. Find the Fourier series of the function f x x , x , f x 2 f x
f f1 f2 f1x x, f2 x © 2012, Ching-Han Hsu, Ph.D. Sawtooth Wave
• Since f1 is odd, an=0 for n=1,2,3,… and 2 L nx bn f1xsin dx L 0 L 2 2 xsin nxdx xd cos nx 0 n 0 2 2 x cos nx cos nxdx 0 n 0 n 2 2 2 cos n 2 sin nx cos n n n 0 n 2 f1x bn sin nx cosn sin nx n1 n1 n © 2012, Ching-Han Hsu, Ph.D. Sawtooth Wave 1 1 f x 2sin x sin 2x sin 3x 2 3
f1x f2 x
© 2012, Ching-Han Hsu, Ph.D. Half-Range Expansion • In some applications, we often need to employ a Fourier series for a function f(x) that is given only on some interval, say 0≦x≦L.
Suppose that we have a choice!! We can use even or odd periodic expansion.
© 2012, Ching-Han Hsu, Ph.D. Half-Range Expansion • If we apply even periodic extension, we obtain a Fourier cosine series:
• If we apply odd periodic extension, we obtain a Fourier sine series:
© 2012, Ching-Han Hsu, Ph.D. Triangle Function: Half-Range Expansion • Ex. Find the two half-range expansion of the triangle function 2k L x 0 x f x L 2 2k L L x x L L 2
© 2012, Ching-Han Hsu, Ph.D. Triangle Function: Half-Range Expansion
Even Expansion
Odd Expansion
© 2012, Ching-Han Hsu, Ph.D. Triangle Function: Even Periodic Expansion
L L 2k L 1 2 x 0 x f x L 2 a0 e f xdx e f xdx 2k L 2L L 2L 0 L x x L L 2 1 2k L / 2 2k L xdx L xdx L L 0 L L / 2 2 2 1 k L k L k L L 2 L 2 2
1 L nx 2 L nx an e f xcos dx e f xcos dx L L L L 0 L 2 2k L/ 2 nx 2k L nx xcos dx L xcos dx L L 0 L L L/ 2 L © 2012, Ching-Han Hsu, Ph.D. Triangle Function: Even Periodic Expansion L/ 2 L/ 2 nx L nx L L/ 2 nx xcos dx xsin sin dx 0 0 L n L 0 n L L2 n L2 n sin cos 1 2n 2 n2 2 2 L nx L xcos dx L / 2 L L L nx L L nx L xsin sin dx L / 2 n L L / 2 n L L2 n L2 n sin cos n cos 2 2 2n 2 n 2
© 2012, Ching-Han Hsu, Ph.D. Triangle Function: Even Periodic Expansion
4k n an 2cos cos n 1 n2 2 2 16k a 0, a , a 0, a 0, a 0 1 2 22 2 3 4 5 16k 16k a , a , 6 62 2 10 10 2 2
an 0, n 2,6,10,14,
k 16k 1 2 1 6 1 10 f x cos x cos x cos x 2 2 22 L 62 L 10 2 L © 2012, Ching-Han Hsu, Ph.D. Triangle Function: Even Periodic Expansion
© 2012, Ching-Han Hsu, Ph.D. Triangle Function: Odd Periodic Expansion
1 L nx 2 L nx bn o f xsin dx o f xsin dx L L L L 0 L 8k n sin n2 2 2
8k 1 1 3 1 5 f x sin x sin x sin x 2 12 L 32 L 52 L
© 2012, Ching-Han Hsu, Ph.D. Triangle Function: Odd Periodic Expansion
© 2012, Ching-Han Hsu, Ph.D. Forced Oscillations • Consider the forced oscillation of a body of mass m on spring of modulus are governed by the equation myt cyt kyt rt where y(t) is the displacement from rest, c the damping constant, and r(t) the external force depending on time t.
© 2012, Ching-Han Hsu, Ph.D. Forced Oscillations • The electric analog to the spring is RLC- circuit: 1 LIt RIt It Et C
© 2012, Ching-Han Hsu, Ph.D. Forced Oscillations • Ex. Let m=1(g), c=0.02(g/s), k=25(g/s2), so that yt 0.02 yt 25 yt rt where r(t) is measured in g‧㎝/s2. Let t t 0 rt 2 , rt 2 rt t 0 t 2 Find the steady-state solution y(t). 0.01t 0.01t yh t Ae cos5t Be sin 5t
t yh t 0 © 2012, Ching-Han Hsu, Ph.D. Forced Oscillations The Fourier series of r(t) is 4 1 1 1 rt cost cos3t cos5t 12 32 52
Now we the following linear differential equation yt 0.02 yt 25 yt 4 rt 2 cos2k 1t k1 2k 1 © 2012, Ching-Han Hsu, Ph.D. Forced Oscillations
The steady-state (particular) solution yn(t) corresponding to the sinusoidal input cos(2k-1)t=cosnt can be computed using the method of undetermined coefficients
yn t An cos nt Bn sin nt 425 n2 0.08 A , B n n2D n nD 2 D 25 n2 0.02n2
y p t y1t y2 t y3 t
© 2012, Ching-Han Hsu, Ph.D. Forced Oscillations 2 2 Let us find the amplitude Cn An Bn
We have
C1 0.0530
C3 0.0088
C5 0.5100
C7 0.0011
C9 0.0003
© 2012, Ching-Han Hsu, Ph.D. Parseval’s Theorem
© 2012, Ching-Han Hsu, Ph.D. Fourier Series Formulae n n f x a0 an cos x bn sin x n1 L L 1 L a0 f xdx 2L L 1 L , nx an f xcos dx L L L 1 L nx bn f xsin dx L L L
© 2012, Ching-Han Hsu, Ph.D. Parseval’s Theorem
• Show that:
L 1 2 2 2 2 f x dx 2a0 an bn L L n1
2 m m f x a0 am cos x bm sin x m1 L L n n a0 an cos x bn sin x n1 L L © 2012, Ching-Han Hsu, Ph.D. L m n ambn cos xsin xdx L L L 1 L n m n m ambn sin x sin xdx 2 L L L 0, m,n
L 2 a0a0dx 2La0 L
© 2012, Ching-Han Hsu, Ph.D. m 1, n 1
L m n aman cos xcos xdx 0, m n L L L L n n anan cos xcos xdx L L L
L L 2 2 n 2 1 2n an cos xdx an 1 cos x dx L L L 2 L 2 Lan , m n
© 2012, Ching-Han Hsu, Ph.D. m 1, n 1
L m n bmbn sin xsin xdx 0, m n L L L L n n bnbn sin xsin xdx L L L
L L 2 2 n 2 1 2n bn sin xdx bn 1 cos x dx L L L 2 L 2 Lbn , m n
© 2012, Ching-Han Hsu, Ph.D. 2 m m f x a0 am cos x bm sin x n1 L L n n a0 an cos x bn sin x n1 L L 2 2 2 n 2 2 n a0 an cos x bn sin x n1 L L m n 2am cos xbn sin x mn L L m n am cos xan cos x mn,m1,n1 L L m n bm sin xbn sin x mn,m1,n1 L © 2012,L Ching-Han Hsu, Ph.D. L L 2 2 2 2 n 2 2 n f xdx a0 an cos x bn sin xdx L L n1 L L 2 2 2 L2a0 an bn n1
L 1 2 2 2 2 f xdx 2a0 an bn L L n1
L 1 2 2 1 2 2 f xdx a0 an bn L 2L 2 n1
© 2012, Ching-Han Hsu, Ph.D. Complex Fourier Series
© 2012, Ching-Han Hsu, Ph.D. Functions of Any Period p=2L
• A function f(x) of period p=2L has a Fourier series n n f x a0 an cos x bn sin x n1 L L 1 L a0 f xdx 2L L n 1,2,3, 1 L nx 1 L nx an f xcos dx bn f xsin dx L L L L L © 2012, Ching-HanL Hsu, Ph.D. Euler Formulae ei cos isin 1 1 cos ei ei , sin ei ei 2 2i nx nx a cos b sin n L n L nx nx nx nx 1 i i 1 i i a (e L e L ) b (e L e L ) 2 n 2i n nx nx 1 i 1 i a ib e L a ib e L 2 n n 2 n n
© 2012, Ching-Han Hsu, Ph.D. Complex Fourier Series
1 1 L nx nx an ibn f xcos isin dx 2 2L L L L nx L i 1 L f xe dx cn 2L L 1 1 L nx nx an ibn f xcos isin dx 2 2L L L L (n)x L i 1 L f xe dx cn 2L L (0)x L i 1 L a0 f xe dx c0 2L L © 2012, Ching-Han Hsu, Ph.D. Complex Fourier Series
nx nx f x a0 an cos bn sin n1 L L nx nx i i 1 L 1 L a0 an ibn e an ibn e n1 2 n1 2 nx nx nx (n)x i i i i L L L L c0 cne cne c0 cne cne n1 n1 n1 n1 nx nx i i L L c0 cne cne n1 n1 nx i L nx cne 1 L i n L cn f xe dx 2L L
© 2012, Ching-Han Hsu, Ph.D. Let Us Play Fourier Series!!
© 2012, Ching-Han Hsu, Ph.D. Functions of Any Period p=2L
• A function f(x) of period p=2L has a Fourier series n n f x a0 an cos x bn sin x n1 L L 1 L a0 f xdx 2L L n 1,2,3, 1 L nx 1 L nx an f xcos dx bn f xsin dx L L L L L © 2012, Ching-HanL Hsu, Ph.D. Periodic Square Wave (I)
• Ex. Find the Fourier series of the function 1 0 x L f x 1 L x 0 Since the function f(x) is odd, there are no constant and cosine terms in the Fourier's
series, i.e., a0=a1=a2=…=0!!
© 2012, Ching-Han Hsu, Ph.D. Periodic Square Wave (I)
1 L nx bn f xsin dx L L L 1 0 nx 1 L nx 1sin dx 1sin dx L L L L 0 L L 2 L nx 2L nx 1sin dx cos 0 L L Ln L 0 2 1 cos n n 21cos n n f x sin x n1 n L© 2012, Ching-Han Hsu, Ph.D. Periodic Square Wave (II)
• Ex. Find the Fourier series of the function 1 0 x L gx 0 L x 0 1 1 1cosn n gx 1 f x sin x 2 2 n1 n L
© 2012, Ching-Han Hsu, Ph.D. Periodic Square Wave (III)
• Ex. Find the Fourier series of the function 0 L / 2 x L hx 1 L / 2 x L / 2 0 L x L / 2
© 2012, Ching-Han Hsu, Ph.D. Periodic Square Wave (III)
L hx g x 2 1 1 cos n n L sin x 2 n1 n L 2 1 1 cos n n nL n nL sin x cos cos xsin 2 n1 n L 2L L 2L 1 1 cos n n n sin cos x 2 n1 n 2 L
© 2012, Ching-Han Hsu, Ph.D. Triangle Wave (I)
• Ex. Find the Fourier series of the function f x x, L x L Since the function f(x) is odd, there are no constant and cosine terms in the Fourier's
series, i.e., a0=a1=a2=…=0!!
© 2012, Ching-Han Hsu, Ph.D. 1 L nx 1 L nx bn f xsin dx xsin dx L L L L L L 2 L nx 2 L L nx xsin dx xd cos L 0 L L n 0 L L 2 nx 2 L nx x cos cos dx 0 n L 0 n L 2L 2 L nx L cos n sin n n n L 0 2L cos n n 2L n f x cos n sin x n1 n L © 2012, Ching-Han Hsu, Ph.D. Triangle Wave (I)
© 2012, Ching-Han Hsu, Ph.D. Triangle Wave (II)
• Ex. Find the Fourier series of the function gx f x x, L x L Since the function f(x) is odd, there are no constant and cosine terms in the Fourier's
series, i.e., a0=a1=a2=…=0!!
2L n gx cosn sin x n1 n L
© 2012, Ching-Han Hsu, Ph.D. © 2012, Ching-Han Hsu, Ph.D. Triangle Wave (II)
© 2012, Ching-Han Hsu, Ph.D. Triangle Wave (III)
• Ex. Find the Fourier series of the function hx f x L x L, L x L 2L n hx L cos n sin x n1 n L
© 2012, Ching-Han Hsu, Ph.D. Triangle Wave (III)
© 2012, Ching-Han Hsu, Ph.D. Triangle Wave (IV)
• Ex. Find the Fourier series of the function px hx L x, L x L L 0 x 2L
© 2012, Ching-Han Hsu, Ph.D. px hx L 2L n L cos n sin x L n1 n L n sin x L L nx nL nL nx sin cos sin cos L L L L nx cos n sin L 2L n px L sin x n1 n © 2012, Ching-HanL Hsu, Ph.D. Triangle Wave (IV)
© 2012, Ching-Han Hsu, Ph.D.