Professional Documents
Culture Documents
Bias Expt6 Ecea106l 2q2223
Bias Expt6 Ecea106l 2q2223
Bias Expt6 Ecea106l 2q2223
The interpretation of The interpretation of The interpretation of The interpretation of The interpretation of
data and discussion data and discussion data and discussion data and discussion data and discussion
C. Interpretation of were not based on the were based on the were based on the were based on the were based on the
data and result and data result and data result and data result and data result and data
discussion gathered during the gathered during the gathered during the gathered during the gathered during the
experiment. experiment, but does experiment, and experiment, and experiment and are
not present clarity. somehow presents mostly presents clarity. presented very clearly.
clarity.
The conclusion was The conclusion was The conclusion was The conclusion was The conclusion was
not based on the based on the based on the based on the based on the
D. Conclusion objectives and all objectives but not all objectives and few of objectives and most of objectives and all of
ideas are not coherent of the ideas are the ideas are coherent the ideas are coherent the ideas are coherent
or clear. coherent nor clear. but not too clear. and clear. and presented very
clearly.
The words used were The words used were The words used were The words used were The words used were
not appropriate, had somehow appropriate, appropriate, had good appropriate, had very appropriate, had
poor grammar, had had good grammar, grammar, had good good grammar, had excellent grammar,
E. Use of Language bad sentence had good sentence sentence construction very good sentence had excellent
construction and ideas construction and not and few of the ideas construction and sentence construction
were not clearly all ideas were clearly were clearly almost all of the ideas and all of the ideas
expressed. expressed. expressed. were clearly were clearly
expressed. expressed.
The laboratory report The laboratory report The laboratory report The laboratory report The laboratory report
F. Promptness was submitted two or was submitted one was submitted three to was submitted beyond was submitted on
more weeks late. week late. six days late the time assigned to time.
two days late.
AVERAGE: (A+B+C+D+E+F)/6
LEE MARVIN I. BIAS
Name:__________________________________ 01-06-23
Date:_____________________
ECEA106L/FOPI01
Course & Section:_________________________ ECE-O/2ND YEAR
Program & Year:____________
Experiment 6
Fourier Series
Objectives
By the end of the experiment, the student should be able to
define the fourier series.
analyze the periodic wave function characteristics using fourier series.
demonstrate the usage of matlab in computing fourier series.
construct a script file for solving fourier series.
Tools Required
Personal Computer/Desktop Computer/Computer Workstation
MATLAB software
Fourier Series
A Fourier series is an expansion of a periodic function in terms of an infinite sum of sines and cosines. Fourier
series make use of the orthogonality relationships of the sine and cosine functions. The computation and
study of Fourier series is known as harmonic analysis and is extremely useful as a way to break up
an arbitrary periodic function into a set of simple terms that can be plugged in, solved individually, and then
recombined to obtain the solution to the original problem or an approximation to it to whatever accuracy is
desired or practical.
where the Fourier coefficients ak, k = 1,2,3,....., and bk, k = 1,2,3,....., bounded at [-L,L], are given by
, , and
Example1.
; period =10
Solution
Matlab Command:
>> syms x
>> pw = piecewise(x>0 & x<5, 4, x>-5 & x<0, -4)
pw =
>> a0 = int(pw,[-5,5])
a0 =
>> L=5
L=
5
>> n=1:10
n=
1 2 3 4 5 6 7 8 9 10
>> k = 1*n
k=
1 2 3 4 5 6 7 8 9 10
>> a = int(pw*cos(k*pi*x/L)/L,x,-L,L)
a=
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>> b = int(pw*sin(k*pi*x/L)/L,x,-L,L)
b=
fs =
Example 2.
Find the fourier series of
Matlab Command
>> syms f x k L n
>> f=abs(x)
f=
abs(x)
>> n=1:10
n=
1 2 3 4 5 6 7 8 9 10
>> a0 = int(f/2*L,x,-L,L)
a0 =
1/2
>> k = 1*n
k=
1 2 3 4 5 6 7 8 9 10
>> a = int(f*cos(k*pi*x/L)/L,x,-L,L)
a=
>> b = int(f*sin(k*pi*x/L)/L,x,-L,L)
b=
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
fs =
> ezplot(fs,x)
>> ezplot(f,-1,1)
>> hold on
>> ezplot(fs,-1,1)
>> hold off
>> title('partial sum with n=2')
Part 1. Exercise:
Find the fourier series of the following periodic functions using manual computations and using matlab
command:
1. ; period = 10
2. ; period = 3600
3. ; period = 3600
4. ; period = 8
MANUAL COMPUTATION:
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
Note: Provide multiple copy of this answer sheet.
MATLAB COMMAND/ SYNTAX:
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
Note: Provide multiple copy of this answer sheet.
Part 2.
Create an m-file that will solve the fourier series of a given periodic waveform. Use the given functions in part
1 to test your created script file and compare the two results(part1 versus part 2).
1. Syntax:
syms x
pw=2*piecewise(x>-5&x<0,0,x>0&x<5,4)
T=10
L=T/2;
a0=(1/(2*L))*(int(pw,[-5,5]))
n=1:10;
k=1*n
a=int(pw*cos(k*pi*x/L)/L,x,-L,L)
b=int(pw*sin(k*pi*x/L)/L,x,-L,L)
fs=a0+sum(a.*(cos(k*pi*x/L))+ b.*(sin(k*pi*x/L)));
pretty(fs)
Answer:
2. Syntax:
syms x t
pw=piecewise(x>-pi&x<pi,2*x^2)
T=2*pi;
L=T/2;
a0=(1/(2*L))*(int(pw,[-pi,pi]))
n=1:10;
k=1*n;
a=int(pw*cos(k*pi*x/L)/L,x,-L,L)
b=int(pw*sin(k*pi*x/L)/L,x,-L,L)
fs=a0+sum(a.*(cos(k*pi*x/L))+ b.*(sin(k*pi*x/L)));
pretty(fs)
Answer:
3. Syntax:
syms x t
pw=2*piecewise(x>-pi&x<0,0,x>0&x<pi,sin(t))
T=2*pi;
L=T/2;
a0=(1/(2*L))*(int(pw,[-pi,pi]))
n=1:10;
k=1*n;
a=int(pw*cos(k*pi*x/L)/L,x,-L,L)
b=int(pw*sin(k*pi*x/L)/L,x,-L,L)
fs=a0+sum(a.*(cos(k*pi*x/L))+ b.*(sin(k*pi*x/L)));
pretty(fs)
Answer:
4. Syntax:
syms x
pw=3*piecewise(x>-4&x<0,-x,x>0&x<4,x)
T=8;
L=T/2;
a0=(1/(2*L))*(int(pw,[-4,4]))
n=1:10;
k=1*n;
a=int(pw*cos(k*pi*x/L)/L,x,-L,L)
b=int(pw*sin(k*pi*x/L)/L,x,-L,L)
fs=a0+sum(a.*(cos(k*pi*x/L))+ b.*(sin(k*pi*x/L)));
pretty(fs)
Answer:
Part 2
1. Syntax:
syms t n
f = 2*piecewise(t>-5&t<0,0,t>0&t<5,4);
T = 10;
L = T/2;
k = 1*n;
a0 = int(f/(2*L),t,-L,L);
an = int(f*cos(k*pi*t/L)/L,t,-L,L);
bn = int(f*sin(k*pi*t/L)/L,t,-L,L);
fs = a0 + sum(an.*(cos(k*pi*t/L))+ bn.*(sin(k*pi*t/L)));
pretty(fs)
Answer:
2. Syntax:
syms t n
f = piecewise(t>-pi&t<pi,2*t^2);
T = 2*pi;
L = T/2;
k = 1*n;
a0 = int(f/(2*L),t,-L,L);
an = int(f*cos(k*pi*t/L)/L,t,-L,L);
bn = int(f*sin(k*pi*t/L)/L,t,-L,L);
fs = a0 + sum(an.*(cos(k*pi*t/L))+ bn.*(sin(k*pi*t/L)));
pretty(fs)
Answer:
3. Syntax:
syms t n o
f =2*piecewise(t>-pi&t<0,0,t>0&t<pi,sin(o));
T = 2*pi;
L = T/2;
k = 1*n;
a0 = int(f/(2*L),t,-L,L);
an = int(f*cos(k*pi*t/L)/L,t,-L,L);
bn = int(f*sin(k*pi*t/L)/L,t,-L,L);
fs = a0 + sum(an.*(cos(k*pi*t/L))+ bn.*(sin(k*pi*t/L)));
pretty(fs)
Answer:
4. Syntax:
syms t n
f = 3*piecewise(t>-4&t<0,-t,t>0&t<4,t);
T = 8;
L = T/2
k = 1*n;
a0 = int(f/(2*L),t,-L,L);
an = int(f*cos(k*pi*t/L)/L,t,-L,L);
bn = int(f*sin(k*pi*t/L)/L,t,-L,L);
fs = a0 + sum(an.*(cos(k*pi*t/L))+ bn.*(sin(k*pi*t/L)))
Answer:
Interpretation
In this experiment, the student explores the concept and ideas about Fourier series through
manual computation together with MATLAB software. The experiment was divided into three parts. The
first one focuses on manually solving the given problems while the second and third part focuses on
utilizing MATLAB to solve the same problem. For the second part, the code pattern stays the same but
they differ on the given resulting to different answers. For the third part of the experiment, same idea
and pattern was done, only the format of the code was a bit different.
Conclusion
The main goal of this experiment is to define the Fourier series and analyze the periodic wave
function characteristics using Fourier series together with demonstrating the usage of MATLAB in
computing Fourier series. Upon completion, the student was able to meet all the goals and perform all
the needed parts in order to complete and fully understand the activities. Further observation shows that
utilizing MATLAB is much easier than manual computation given that the user is knowledgeable of the
process and MATLAB interface.