Professional Documents
Culture Documents
Complex Engineering Problem Signals and Systems EE-231L
Complex Engineering Problem Signals and Systems EE-231L
1
Complex Engineering Problem Signals and Systems EE-231L
ABSTRACT:
Complex Engineering Problem of Signals and Systems Lab comprises of designing a Generic
Code whilst Utilizing Matlab.
The Code aims to design an equivalent Fourier series applicable to all Periodic Function’s f (t)
input in order to show function’s signal representation as a series of functions
INTRODUCTION:
Fourier series is infinite series expression of periodic signals in accord with trigonometric sine
and cosine function. Whereas A periodic Function is a function f(x) with period T >0 if the values
of the function repeat them regular intervals of independent variable x.
Fourier Series is helpful as if we expand functions in accord with trigonometric identities that
are of sine’s and cosines , so Fourier series is of use because it allows one to more easily analyze
and solve functions that are discontinuous or simply difficult to represent analytically.
FUNCTION:
F (t) = [ x 4 when−π ≤ x ≤ π
0,otherwise ]
If f (t) is a periodic function of period T, then under certain conditions, its Fourier series is given
by:
∞
X (t) = a0 + ∑ an cos 2nt +b n sin 2 nt
n=1
Where
2
Complex Engineering Problem Signals and Systems EE-231L
❑
1
a0 = ∫ f ( t ) dt
T0 T 0
4
π
a0 = = 19.48
5
❑
2
an = ∫ f (t ) cos n w 0 t dt
T0 T 0
2π 2π
Where w 0= = = 1;
T0 2π
π
2
an = ∫ x 4 cos (n x) dx
T 0 −π
π
1
an = ∫ x 4 cos (n x) dx
π −π
Problem:
π
∫ x 4 dx cos (n x)
−π
Now solving:
∫ x 4 cos(n x )dx
Integrate by parts: ∫udv = uv−∫v du
u= x 4 , dv = cos(nx)
sin ( nx )
du= 4 x 3 dx , v =
n
4
x sin ( nx ) 4 x 3 sin ( nx )
∫ x 4 dx cos (n x)= -∫ dx
n n
Now solving:
3
Complex Engineering Problem Signals and Systems EE-231L
4 x 3 sin ( nx )
∫ dx
n
Apply linearity:
4
= ∫ x 3 sin ( nx ) dx
n
Now solving:
∫ x 3 sin ( nx ) dx
Integrate by parts: ∫udv = uv−∫v du
u= x 3 , dv = sin(nx)
cos (nx)
du= 3 x2 dx , v = -
n
3
−x cos (nx) −3 x 2 cos ( nx)
∫ x 3 sin(n x )dx= -∫ dx
n n
Now solving:
−3 x 2 cos ( nx)
∫ dx
n
Apply linearity:
−3
= ∫ x 2 cos ( nx ) dx
n
Now solving:
∫ x 2 cos ( nx ) dx
Integrate by parts: ∫udv = uv−∫v du
u= x 2 , dv = cos(nx)
sin ( nx )
du= 2 x 1 dx , v =
n
2
x sin (nx) 2 x sin ( nx )
∫ x 2 cos (n x) dx= -∫ dx
n n
Now solving:
2 x sin ( nx )
∫ dx
n
Apply linearity:
2
= ∫ x sin ( nx ) dx
n
Now solving:
4
Complex Engineering Problem Signals and Systems EE-231L
∫ x sin ( nx ) dx
Integrate by parts: ∫udv = uv−∫v du
u=x, dv = sin(nx)
−cos ( nx )
du= dx , v =
n
−x cos ( nx) −cos ( nx )
∫ x sin (n x)dx= -∫ dx
n n
Now solving:
−cos ( nx )
∫ dx
n
1
Substitute u=nx ⟶ dx = du
n
1
=− ∫cos(u)du
n2
Now solving:
∫cos(u)du
This is a standard integral:
=sin(u)
5
Complex Engineering Problem Signals and Systems EE-231L
6
Complex Engineering Problem Signals and Systems EE-231L
❑
2
bn = ∫ f ( t ) sin n w0 t dt
T0 T 0
2π 2π
Where w 0= = = 1;
T0 2π
π
2
bn = ∫ x 4 sin( n x ) dx
T 0 −π
π
1
bn = ∫ x 4 sin (n x) dx
π −π
As we know sin( π ¿ = 0
So; bn =0
Put all the values of a0 , an ∧bn in to Fourier expression
∞
x(t)= a0 + ∑ an cos 2nt +b n sin 2 nt
n=1
∞
8 ( π 2 n 2−6 ) cos ( π n )
x(t)= 19.48 + ∑ n4
cos 2nt +(0)sin 2 nt
n=1
∞
8 ( π 2 n 2−6 ) cos ( π n )
x(t)= 19.48 + ∑ n
4
cos 2nt
n=1
7
Complex Engineering Problem Signals and Systems EE-231L
close all
clear all
clc
syms x
pi=3.14;
sum=0;
y=exp(-x/2); %Desired Function
ao=(1/pi)*int(y,x,-pi,pi);
for n=1:90
%Finding the Co efficient
an=(1/pi)*int(y*cos(n*x),x,-pi,pi);
bn=(1/pi)*int(y*sin(n*x),x,-pi,pi);
sum=sum+(an*cos(n*x)+bn*sin(n*x));
grid on;
ezplot(x,(sum+ao/2),[-5*pi,5*pi]);
end
N=1
8
Complex Engineering Problem Signals and Systems EE-231L
N=2
N=5
9
Complex Engineering Problem Signals and Systems EE-231L
N=10
N=15
N=20
10
Complex Engineering Problem Signals and Systems EE-231L
N=35
N=50
CONCLUSION:
After observing the working principles and methods of how Fourier series operates when it
comes to decomposing a Periodic Signals into series of function ,the desired outcome has been
attained.
The Matlab code created was provided with different inputs for different plots and the
representation of Comparison in graphs of Fourier series was seen each time .Upon increment
in value of both the graphs was more synchronized.
11