You are on page 1of 14

ECE 307

Fourier Series

Z. Aliyazicioglu
Electrical & Computer Engineering Dept.
Cal Poly Pomona

Fourier Series
Periodic signal is a function that repeats itself every T seconds.

x(t ) = x(t nT )
T: period of a function, n: integer 1,2,3,

x(t)

t
T x(t)
2T 3T
x(t)
t
T 2T
t
T 2T

1
Fourier Series
Periodic signal can be represented as sum of sinusoidals if the
signal is square-integrable over an arbitrary interval ().

t1 +T


t1
x(t ) dt <

So, it can be expressed as


2

where 0 =
x(t ) = a0 + an cos(n0t ) + bn sin(n0t ) T0
n =1 n =1
0 fundamental frequency
= c0 + cn cos(n0t + n ) of the periodic function in
n =1
[rad/s].

n0 , for n = 2,3,4,...
= Xe
n =
n
jn0t
are harmonic frequencies

Fourier Series
The parameters are called Fourier series expansion or coefficients and
given by
t1 +T0
1
a0 =
T0
t1
x(t )dt
Where t1 is arbitrary. It
t1 +T0 can be set t1 = 0 or
2
an =
T0
t1
x (t ) cos( n 0t )dt
n = 1, 2,3,...
t1 = T0 / 2

t1 +T0
2
bn =
T0
t1
x (t ) sin(n 0t )dt
n = 1, 2,3,...
bn
cn = an2 + bn2 n = tan
an
c0 = a0
t1 +T0
1
Xn =
T0
t1
x (t )e jn0t dt
n = 1, 2, 3,...

2
Fourier Series
Using Eulers rule, X n can be written as

t1 +T0 t1 +T0
1 1
Xn =
T0 x(t )cos(n0t )dt j
T0 x(t )sin(n0t )dt Xn =
1 1
an j bn
t1 t1 2 2

If x(t) is a real-valued periodic signal, we have


*
1
t1 +T0
1 t1+T0 1 1
x(t )e 0 dt
jn0t jn t
X n = x(t )e dt = X n = an + j bn
T0 t1
T0 t1 2 2

X n = X *
n

To obtain and
1
an = 2Re {X n } bn = 2 Im {X n }
Xn = cn e jn , n = 1, 2,3
2

Fourier Series
Remember that
t1 +T0


t1
cos(n0t ) dt = 0 for all n

t1 +T0


t1
sin(n0t ) dt = 0 for all n

t1 +T0


t1
cos(n0t ) sin(m0t ) dt = 0 for all n and m

t1 +T0 t1 +T0


t1
cos(n0t ) cos(m0t ) dt = 0 for all n m
t1
sin(n0t ) sin(m0t ) dt = 0 for all n m

T T
= for all n = m = for all n = m
2 2

3
Fourier Series
Example: Find the Fourier series of the following periodic signal
v(t)
Vm
Vm
v (t ) = t t
T
T 2T 3T
t1 +T0 T
1 1 Vm 1V T 1
a0 =
T0
t1
x(t )dt =
T 0 T
t dt = m t 2 = Vm
T 2T 0 2
T T
2 Vm 2V
T 0 T
an = t cos( n 0t ) dt = 2m t cos( n 0t ) dt
T 0
2Vm 1 t T
= 2 2 2
cos( n 0t ) + sin( n0t )
T n 0 n 0 0
2Vm 1 2 1
= cos( n T ) 2 2 = 0 for all n
T 2 n 2 02 T n 0

Fourier Series
T T
2 Vm 2V
T 0 T
bn = t sin( n 0t ) dt = 2m t sin( n 0t ) dt
T 0
2Vm 1 t T
= sin(n0t ) cos( n 0t )
T 2 n 2 02 n 0 0
2Vm T 2 V
= 0 cos( n T ) = m for n
T2 n 0 T n

The Fourier Series



Vm Vm
v (t ) = a0 + bn sin(n0t ) v (t ) = sin(n0t )
n =1 2 n =1 n

Vm Vm V V
v (t ) = sin(0t ) m sin(20t ) m sin(30t ) ...
2 2 3

4
Fourier Series
Lets assume that Vm=2V and T=1ms 2
0 = = 2 1000 rad/s
T0
>> Vm=2;
>> T=0.001;
>> w0=2*pi/T;
>> t=0:0.00001:0.002;
>> v1=Vm/2-Vm/pi*sin(w0*t);
>> plot (t,v1)
>> hold on;
>> v2=Vm/2-Vm/pi*sin(w0*t)-
Vm/(2*pi)*sin(2*w0*t);
>> plot (t,v2)
>> v3=Vm/2-Vm/pi*sin(w0*t)-
Vm/(2*pi)*sin(2*w0*t)-
Vm/(3*pi)*sin(3*w0*t);
>> plot (t,v3)
>> v4=Vm/2-Vm/pi*sin(w0*t)-
Vm/(2*pi)*sin(2*w0*t)-
Vm/(3*pi)*sin(3*w0*t)-
Vm/(4*pi)*sin(4*w0*t);
>> plot (t,v4)
>> xlabel ('t[s]')
>> title('v(t)')

Fourier Series
Vm
bn = for n=1,2,3,...
n

Vm
cn = an2 + bn2 = for n=1,2,3,...
n
bn
n = tan = 90 v (t ) = c0 + cn cos(n0t + n )
an
n =1

1 1 1 Vm 1 1 Vm j 90
Xn =
2
an j bn = j
2 2 n Xn = cn e jn = e
2 2 n
X 0 = c0

5
Fourier Series
The Effect of symmetry on the Fourier Coefficients

Even-function symmetry

Even-function is defined as x (t ) = x ( t )
t1 +T0 T0 / 2
1 4
a0 =
T0 x(t )dt an =
T0 0
x (t ) cos( n 0t )dt bn = 0 for all n
t1

x(t)

t
T 2T

Fourier Series
The Effect of symmetry on the Fourier Coefficients

Odd-function symmetry

Odd-function is defined as x (t ) = x ( t )
t1 +T0
1 4
T0 / 2
a0 =
T0
t1
x(t )dt bn =
T0 0
x (t )sin( n 0t )dt an = 0 for all n

x(t)

-T T t

6
Fourier Series
Example: x(t)

-T0 -t1 t1 T0

Assume that ,A=1 ,T0 = 4 s and t1 = 1 s Determine Fourier


series coefficients of in exponential and trigonometric form.
Plot the discrete spectrum of x(t).

x (t ) = x ( t ) t1 +T0
4
T0 / 2
1
a0 = x(t )dt an =
T0 x (t ) cos( n 0t )dt
T0 t1
0

bn = 0 for all n

Fourier Series
Example: 1 T0 / 4 1
a0 = 1 dt = t
T0 / 4

T0
T0 / 4
T0 / 4 T0
1 T T 1
= 0 + 0 =
T0 4 4 2
T0 / 4
4 4 1
an = 1cos(n t ) dt = T sin( n 0t ) T0 / 4

0 n 0
0 0
T0 0

4 1 2 T0 2 n
= sin( n ) 0 = sin
T0 n 2 T0 4 n 2
T0

2 2 2 2
an = ,0, ,0, ,0, ,....
3 5 7
1 2 2 2 2
x(t ) = + cos(0t ) cos(30t ) + sin(50t ) cos(70t )...
2 3 5 7

7
Fourier Series

>> t=0:0.001:8;
>> T=4;
>> w0=2*pi/T;
>> v=1/2+2/pi*cos(w0*t)-
2/(3*pi)*cos(3*w0*t)+2/(5*pi
)*cos(5*w0*t)-
2/(7*pi)*cos(7*w0*t);
>> plot (t,v)
>> xlabel ('t[s]')
>> title('v(t)')

Fourier Series
Example :
1
1 1
4 1
Xn = 1e jn0t dt = e jn0 e jn0
j 4n0
1 1 jn0
= e
e jn0
2n0 j 2
1 1 sin(n0 )
= sin(n0 ) =
2n0 2 n0
1 sin(n 2 / 4) 1 sin(n / 2)
= =
2 n2 / 4 2 n / 2
1 n
= sinc( )
2 2

sin( x )
where sinc( x ) =
x

8
Fourier Series

1 n
Example.1: (cont) x(t ) = Xe
n =
n
jn0t
= 2 sinc( 2 )e
n =
jn0t

Since is real and even,


n 1 n
an = 2 X n = sinc( ) a0 = cn = sinc( )
2 2 2

bn = 2 X n sin(X n ) = 0 n = 0,
1 n
x (t ) = + sinc( ) cos( n0t )
2 n =1 2 x(t) n=1,3, 5,has odd numbers
harmonics. The even numbers
Since 0 = 2 / 4 harmonics are zero. Xn is always real,
so that the phase is either zero or .
1 n n t The magnitude of discrete spectrum is
x(t ) = + sinc( ) cos( ) shown in next page.
2 n =1 2 2

Fourier Series
Example.1: (cont)

Xn signal as sinc function

>> n=-10:1:10;
>> x=0.5*sinc(n/2);
>> stem (n,x)
>> title('The 1/2*sinc(n/2) signal');
>> xlabel('n');

9
Fourier Series
Example.1: (cont) >> t=-5:0.1:5;
>> n=0;
>> x=0.5;
>> plot (t,x)
>> hold on
>> n=1;
>> an=(sinc(n/2)*cos(2*pi*t*n/4));
>> x=x+an;
>> plot (t,x)
>> n=3;
>> an=(sinc(n/2)*cos(2*pi*t*n/4));
>> x=x+an;
>> plot (t,x)
>> n=5;
>> an=(sinc(n/2)*cos(2*pi*t*n/4));
>> plot (t,x)
>> x=x+an;
>> plot (t,x)
>> n=7;
Fourier series approximation >> an=(sinc(n/2)*cos(2*pi*t*n/4));
of signal x(t) for . >> x=x+an;
>> plot (t,x,'r')
n = 0,1,3,5, and 7 >> title('Fourier Series approximation for
Different n values')
>>

Fourier Series
x(t)
Example. 2:
1

t
-T0 -T0/4 0 -T0/2 T0

-1

t1 +T0
1
a0 =
T0
t1
x(t )dt = 0

t1 +T0
1
Xn =
T0
t1
x(t )e jn0t dt n = 1, 2, 3,...

1 T0 / 2 jn t T0

Xn = e 0
dt + e jn0t dt
T0 0 T0 / 20

10
Fourier Series
Example. 2: (cont)
1 1 T0 / 2 1 T0
Xn = e jn0t e jn0t
T0 jn 0 0 jn0 T0 / 2

1 1 1
Xn = (e jn0T0 / 2 e jn0 0 ) (e jn0T0 e jn0T0 / 2 )
T0 jn0 jn0

1 1
2 T0 2 2 T0
jn jn T0 jn
Xn = 1 e 0 + e 0 e 0
T 2 T T 2

T0 j n 2
T0

1
Xn = 1 e jn + e jn 2 e jn
jn 2

2
Xn = 1 e jn
jn2

Fourier Series
Example. 2: (cont) n Xn
1 0-j 0.6366

2 j n j n j n 2 0+j0
Xn = e 2 e 2 e 2
jn 2 3 0-j0. 212
4 0+j0
2 j 2 n 5 0-j0. 127
Xn = e sin 2 n n = 1, 2, 3,...
n 6 0+j0
7 0-j 0. 0909
8 0+j0

j n
sin n
j n n
Xn = e 2 2 = e 2
sinc ( ) 9 0-j0. 0707
n 2
10 0+j0
2
11 0-j 0. 05787
>> n=1:11;
>> x=(2./(pi*n)).*(sin(pi/2*n)).*exp(-j*(pi*n/2));

11
Fourier Series
Example. 2: (cont)

1 1
Xn = an j bn bn=(-2)*imag(x)
2 2
n 1 2 3 4 5 6 7 8 9 10 11

bn 1.27 0 0.4244 0 0.2546 0 0.1818 0 0.1414 0 0.1157


3 9 7

x(t ) = 1.273sin0t + 0.4244 sin30t + 0.2546 sin50t + 0.1818sin70t + ....

4 1 1 1
x(t ) = sin0t + sin30t + sin50t + sin70t + ....
3 5 7

Fourier Series
Example. 2: (cont) >> t=0:0.000001:0.002;
>> b1=1.273*sin(2*pi*1000*t);
>> plot (t,b1)
>> hold on
>> b3=0.4244*sin(2*3*pi*1000*t);
>> b=b1+b3;
>> plot (t,b,'r')
>> b5=0.2546*sin(2*5*pi*1000*t);
>> b=b1+b3+b5;
>> plot (t,b,'g')
>> b7=0.18189*sin(2*7*pi*1000*t);
>> b=b1+b3+b5+b7;
>> plot (t,b,'y')
>> b9=0.14147*sin(2*9*pi*1000*t);
>> plot (t,b,'m')
>> title ('sum (b_n sin(n \omega t)')
>>

12
Fourier Series
Example. 2: (cont)
>>n=1:11;
>>
x=(2./(n)).*(sin(pi/2*n)).*exp(j
*(pi*n/2));

xn=abs(x);
theta=(180*angle(x))/pi;

subplot (2,1,1);
stem(n,xn)
xlabel('n\omega_0');
ylabel('X_n');
title('X_n(n\omega_0)');

subplot (2,1,2)
stem(n,theta)
xlabel('n\omega_0')
ylabel('\theta')
title('\theta (n\omega_0)');

Fourier Series
Problem.1 x(t)

t
-T0 0 t1 T0

Assume that ,A=1 ,T0 = 4 s and t1 = 1 s Determine Fourier


series coefficients of in exponential and trigonometric form.
Plot the discrete spectrum of x(t).
Compare with Example 1

13
Fourier Series
Problem:
Write the Fourier series for the following periodic signal and
plot the sum of first 10 harmonics

x(t)

t
-T0 -T0/4 0 -T0/4 T0

-1

x(t ) = 1.273cos0t 0.4244cos30t + 0.2546cos50t 0.1818cos70t + ....

14