Trigonometric Fourier Series & Fourier Series Properties: Spring 2014 Type The Document Title
Trigonometric Fourier Series & Fourier Series Properties: Spring 2014 Type The Document Title
LAB # 10
1 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
t0 T
1
a0
T
t0
x(t ) dt 10.2
t0 T
2
bn
T
t0
x(t ) cos(n0t ) dt , n 1, 2,3,... 10.3
t0 T
2
cn
T
t0
x(t )sin(n0t ) dt , n 1, 2,3,... 10.4
Example:
The signal that will be expanded is the same signal used at the previous example. Thus, the
problem is to expand in trigonometric Fourier series the signal x(t ) et ,0 t 3 .
First the trigonometric Fourier coefficients bn , cn and the dc component a0 are computed
according to equations 10.3, 10.4 and 10.2, respectively, for n 1, 2,..., 200 . Next, x(t ) is
approximated according to the relationship (equation 10.5)
N N
x(t ) a0 bk cos(k 0t ) ck sin(k 0t )
k 1 k 1
Commands Results/Comments
T=3; Definition of t0 0, T 3, 0 2 T and of the
t0=0;
w=2*pi/T; signal x(t )
2 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
syms t
x=exp(-t);
In order to understand the importance of the number terms used for the approximation of the
original signal x(t ) , the approximate signal xx(t ) is constructed for different values of n .
Approximation with five terms ( n 1,...,5 )
Commands Results/Comments
clear b c When the signal is approximated with 5 terms,
for n=1:5
b(n)=(2/T)*int(x*cos(n*w*t),t,t0,t0+T); it is pretty dissimilar to the original signal.
c(n)=(2/T)*int(x*sin(n*w*t),t,t0,t0+T);
end
k=1:5;
xx=a0+sum(b.*cos(k*w*t))+sum(c.*sin(k*w*t))
ezplot(xx, [t0 t0+T]);
title('Approximation with 6 terms')
3 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
Commands Results/Comments
for n=1:20 The approximated signal xx(t ) is now
b(n)=(2/T)*int(x*cos(n*w*t),t,t0,t0+T);
c(n)=(2/T)*int(x*sin(n*w*t),t,t0,t0+T); approximated by 20 terms and it is quite similar
end to the original signal. The approximation is
k=1:20; quite satisfactory.
xx=a0+sum(b.*cos(k*w*t))
+sum(c.*sin(k*w*t));
ezplot(xx, [t0 t0+T]);
title('Approximation with 21 terms')
10.2.1 Linearity
Suppose that the complex exponential Fourier series coefficients of the periodic signals x(t ) and
y (t ) are denoted by ak and bk , respectively, or In other words x(t ) ak and y(t ) bk . Moreover,
let z1 , z2 denote two complex numbers. Then
To verify the linearity property, we consider the periodic signals x(t ) cos(t ) , y(t ) sin(2t ) and the
scalars z1 3 2i and z2 2 .
4 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
Commands Results/Comments
t0=0; First we determine the complex exponential
T=2*pi;
w=2*pi/T; Fourier series coefficients of the left part; that is,
syms t we compute the coefficients of the signal
z1=3+2i; z2=2; f (t ) z1 x(t ) z2 y(t ) . The period of f (t ) is T 2
x=cos(t); y=sin(2*t);
f=z1*x+z2*y;
k=-5:5;
left=(1/T)*int(f*exp(-j*k*w*t),t,t0,t0+T);
left=eval(left);
subplot(211);
stem(k,abs(left));
legend('Magnitude');
title('Coefficients of the left part');
subplot(212);
stem(k,angle(left));
legend('Angle');
The two graphs are identical; thus the linearity property is verified.
A shift in time of the periodic signal results on a phase change of the Fourier series coefficients. So,
if x(t ) ak , the exact relationship is
x(t t1 ) e jk0t1 ak
5 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
In order to verify time shifting property, we consider the periodic signal that in one period is
given by x(t ) te5t ,0 t 10 . Moreover, we set t1 3 . Consequently the signal x(t t1 ) is given by
x(t t1 ) x(t 3) (t 3)e5(t 3) .
Commands Results/Comments
t0=0; First the Fourier series coefficients for the given
T=10;
w=2*pi/T; signal are computed and plotted.
syms t
x=t*exp(-5*t)
k=-5:5;
a=(1/T)*int(x*exp(-j*k*w*t),t,t0,t0+T);
a1=eval(a);
subplot(211);
stem(k,abs(a1));
title(' Coefficients of x(t)=te^-^5^t');
legend('Magnitude');
subplot(212);
stem(k,angle(a1));
legend('Angle');
6 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
The two last graphs are identical; hence, the time shift property is confirmed. Comparing the two
last graphs with the first one, we notice that indeed the magnitude does not change, but the phase
is different.
The Fourier series coefficients of the reflected version of a signal x(t ) are also a reflection of the
coefficients of x(t ) . So, if x(t ) ak , the mathematical expression is
x(t ) a k
In order to validate the time reversal property, we consider the periodic signal that in one period
is given by x(t ) t cos(t ),0 t 2 .
Commands Results/Comments
t0=0; Fourier series coefficients ak are computed and
T=2*pi;
w=2*pi/T; plotted.
syms t
x=t*cos(t) ;
k=-5:5;
a=(1/T)*int(x*exp(-j*k*w*t),t,t0,t0+T);
a1=eval(a);
subplot(211);
stem(k,real(a1));
legend('Re[a_k]');
title('Coefficients of x(t)');
subplot(212);
stem(k,imag (a1));
legend('Im[a_k]');
7 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
The Fourier series coefficients of a time scaled version x(t ) and x(t ) do not change. On the other
hand, the fundamental period of the time scaled version becomes T , and the fundamental
frequency becomes 0 . The mathematical expression is
x(t ) ak
The time scaling property is confirmed by using the periodic signal that in one period is given by
x(t ) t cos(t ),0 t 2 .
Commands Results/Comments
syms t First the Fourier series exponential components
t0=0;
T=2*pi; ak , 5 k 5 for the signal
w=2*pi/T; x(t ) t cos(t ),0 t 2 are computed and
x=t*cos(t) ;
k=-5:5; plotted.
a=(1/T)*int(x*exp(-j*k*w*t),t,t0,t0+T);
a1=eval(a)
subplot(211);
stem(k,abs(a1));
legend('Magnitude');
title(' Coefficients of x(t)');
subplot(212);
stem(k,angle(a1));
legend('Angle');
8 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
The Fourier series coefficient of the product of two signals equals the convolution of the Fourier
series coefficients of each signal. Suppose that x(t ) ak and y(t ) bk , we have 10. 6 as
x(t ) y(t ) ak * bk
Where * denotes discrete time convolution. To verify property 10.6, we consider the signals
x(t ) cos(t ) and y(t ) sin(t ) .
Commands Results/Comments
syms t First, the exponential Fourier series coefficients
t0=0;
T=2*pi; ak , 5 k 5 and bk , 5 k 5 and their
w=2*pi/T; convolution is computed. Notice that the
x=cos(t) ;
k=-5:5;
convolution dk ak * bk is implemented between
a=(1/T)*int(x*exp(-j*k*w*t),t,t0,t0+T); two complex valued sequences.
a1=eval(a);
y=sin(t);
b=(1/T)*int(y*exp(-j*k*w*t),t,t0,t0+T);
b1=eval(b);
left=conv(a1,b1);
subplot(211);
stem(-10:10,abs(left));
legend('Magnitude');
title(' a_k*b_k');
subplot(212);
stem(-10:10,angle(left));
legend('Angle');
9 | Khuram Naveed
[ Spring 2014] TYPE THE DOCUMENT TITLE Signals and Systems
Tasks
Task 01: The periodic signal x(t ) is defined in one period as x(t ) tet ,0 t 6 . Plot approximate
signal using 81 terms of trigonometric form of Fourier series.
Task 02: Plot the coefficients of the trigonometric Fourier series for the periodic signal that in one
period is defined by x(t ) et , 3 t 3 .
2
10 | Khuram Naveed