Fourier Series for Periodic Functions Lecture #8 5CT3,4,6,7 BME 333 Biomedical Signals and Systems - J.Schesser 2 Fourier Series for Periodic Functions • Up to now we have solved the problem of approximating a function f(t) by fa(t) within an interval T. • However, if f(t) is periodic with period T, i.e., f(t)=f(t+T), then the approximation is true for all t. • And if we represent a periodic function in terms of an infinite Fourier series, such that the frequencies are all integral multiples of the frequency 1/T, where k=1 corresponds to the fundamental frequency of the function and the remainder are its harmonics. 1 ak T T 2 T 2 f (t )e j 2 kt T f (t ) a0 [a k e dt j 2 kt T k 1 f a (t ) a0 Ck cos( k 1 ak * e j 2 kt T ] ae k k j 2 kt T a0 2 Re[a k e j 2 kt T ] k 1 j 2 kt k ), where 2a k Ck e j k and a0 C0 T BME 333 Biomedical Signals and Systems - J.Schesser 3 Another Form for the Fourier Series 2 kt f (t ) C0 Ck cos( k ) T k 1 2 kt 2 kt ) Bk sin( ) A0 Ak cos( T T k 1 where Ak Ck cos k and Bk -Ck sin k and A0 C0 BME 333 Biomedical Signals and Systems - J.Schesser 4 Fourier Series Theorem • Any periodic function f (t) with period T which is integrable ( f (t)dt ) can be represented by an infinite Fourier Series • If [f (t)]2 is also integrable, then the series converges to the value of f (t) at every point where f(t) is continuous and to the average value at any discontinuity. BME 333 Biomedical Signals and Systems - J.Schesser 5 Properties of Fourier Series • Symmetries – If f (t) is even, f (t)=f (-t), then the Fourier Series contains only cosine terms – If f (t) is odd, f (t)=-f (-t), then the Fourier Series contains only sine terms – If f (t) has half-wave symmetry, f (t) = -f (t+T/2), then the Fourier Series will only have odd harmonics – If f (t) has half-wave symmetry and is even, even quarter-wave, then the Fourier Series will only have odd harmonics and cosine terms – If f (t) has half-wave symmetry and is odd, odd quarterwave,then the Fourier Series will only have odd harmonics and sine terms BME 333 Biomedical Signals and Systems - J.Schesser 6 Properties of FS Continued • Superposition holds, if f(t) and g(t) have coefficients fk and gk, respectively, then Af(t)+Bg(t) => Afk+Bgk j 2 kt • Time Shifting: f (t ) ak e T k f (t t1 ) ae k k j 2 kt T (ak )delayed (ak )original e e j 2 kt1 T ae k k j 2 kt1 T e j 2 kt T j 2 kt1 T • Differentiation and Integration j 2 k (ak )original T T (ak )original j 2 k (ak )derivative (ak )integral BME 333 Biomedical Signals and Systems - J.Schesser 7 FS Coefficients Calculation Example f (t ) 0, 2 t 0 f (t ) E , 0 t 1 E -4 -3 -2 -1 1 2 3 f (t ) 0, 1 t 2 f (t ) f (t 4) 4 j 2 kt j 2 kt j 2 kt 1 4 4 ak [ 0e dt Ee dt 0e 4 dt ] 4 2 0 1 0 1 1 E e 4 j 2 k 4 2 j 2 kt 1 4 0 j k 2 | Since 2ak Ck , then f (t ) j k 4 j k 4 E E 4 2 k 1 2 j k 4 E Ee e e 1.5 1] [e [ ] j2 j 2 k k 1 k sin( ) j k E 4 e 4 , k 0 0.5 4 k 0 4 0 1 2 3 4 5 1 E E -0.5 a 0 dt 40 4 BME 333 Biomedical Signals and Systems - J.Schesser 6 k 4 cos( 2 kt k ) k 4 4 4 sin 7 8 9 10 11 12 13 14 15 16 17 18 19 20 8 Example Continued 2 1.5 1 term 1 0.5 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -0.5 2 1.5 10 terms 1 0.5 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -0.5 BME 333 Biomedical Signals and Systems - J.Schesser 9 Frequency Spectrum of the Pulse Function • In the preceding example, the coefficients for each of the cosine terms was proportional to sin (k 4) (k 4) • We call the function Sa( x) sin x x the Sampling Function • If we plot these coefficients along the frequency axis we have the frequency spectrum of f(t) 1.2 1 0.8 0.6 0.4 0.2 0 -30 -20 -10 -0.2 0 10 20 -0.4 BME 333 Biomedical Signals and Systems - J.Schesser 10 30 Frequency Spectrum Note that the periodic signal in the time domain exhibits a discrete spectrum (i.e., in the frequency domain) 1.5 1 0.5 0 -15 -10 -5 0 5 10 15 -0.5 Frequency (k/4) BME 333 Biomedical Signals and Systems - J.Schesser 11 Another Example V This signal is odd, H/W symmetrical, and mean=0; this means no cosine terms, odd harmonics and mean=0. T 1 0 ak [ T Ve T 2 j 2 kt T dt Ve j 2 kt 0 T T 2 V 1 e [ | j k 2 T T V [1 cos k ] j k T 2 0 j 2 kt T dt ] j 2 kt T T 2 0 1 e | j 2 k T 2V for k odd, j k 0 for k even. f (t ) 2 2V cos( 2kt 90 ) k T k odd 4V sin( 2kt ) k T k odd 2 1.5 1 0.5 0 -0.5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -1 2V 90 for k odd. k BME 333 Biomedical Signals and Systems -1.5 - J.Schesser 12 Fourier Series of an Impulse Train or Sampling Function x(t ) (t nT ) n j 2 k t 1 T2 ak T x(t )e T dt T 2 -3.5 -2.5 -1.5 -0.5 0.5 1.5 2.5 3.5 j 2 k t 1 T2 T (t )e T dt T 2 1 for all k T 1 j 2Tk t x(t ) e T k BME 333 Biomedical Signals and Systems - J.Schesser 13 Fourier Series for Discrete Periodic Functions x[n] a0 ak e j 2kn T k 1 j 2kn T ak e k 1 a e k k j 2kn T T j 2kn 1 2 ak x[n]e T T n T 2 Since x[n] is discrete, this becomes a summation Notice the similarities to the previous example. BME 333 Biomedical Signals and Systems - J.Schesser 14 • Homework Problem (1) – • Compute the Fourier Series for the periodic functions a) f(t) = 1 for 0<t<π, f(t)=0 for π<t<2π b) f(t) = t for 0<t<3 Problem (2) – Compute the Fourier series of the following Periodic Functions: • f(t)= t, 2nπ < t < (2n+1)π for n ≥ 0 = 0, (2n+1)π < t < (2n+2)π for n ≥ 0 f(t)= e-t/π, 2nπ < t < (2n+2)π for n ≥ 0 Use Matlab to plot f(t) using ak for maximum number of components, N=5,10, 100, and1000. Show your code. • • Problem (3) – Problems: 4.1/3 Find the Fourier series of the following waveforms (choose tc=To/4): 1.5 1 0.5 0 0 1 2 3 4 5 -To -0.5 -1 -(To+ tc) -To/2 -tc - (To- tc) tc To/2 To To- tc To+ tc -1.5 BME 333 Biomedical Signals and Systems - J.Schesser 15 Homework • Problem (4) – Deduce the Fourier series for the functions shown (hint: deduce the second one using superposition): -π+a -a -π • π+a 2π-a a π-a π 4π/3 5π/3 -π -2π/3 -π/3 2π π/3 2π/3 π 2π 5CT.7.1 BME 333 Biomedical Signals and Systems - J.Schesser 16