Professional Documents
Culture Documents
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
ADVANCED ELECTRONICS ENGINEERING MATHEMATICS LABORATORY
ECEA106L – B14
EXPERIMENT 6
Fourier Series
LABORATORY REPORT 6
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).
Exercises:
Part 1: Exercise
Find the fourier series of the following periodic functions using manual computations and using
matlab command:
1.
MANUAL COMPUTATION:
MATHLAB COMMAND/ SYNTAX:
syms x n
L = 5;
a0 = (1/(2*L))*(int(pw, [-5,5]));
k = 1*n;
a = (int(pw*cos(k*pi*x/L)/L,x,-L,L));
b = (int(pw*sin(k*pw*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.
MANUAL COMPUTATION:
syms n t;
L = pi;
y = 2*t^2;
a0 = (int(y,-L,L));
b0 = a0*(1/(2*L));
n = 1:3;
k = 1*n;
an = (1/L)*((int(y,-L,L))*(cos((k*pi*t)/L)));
bn = (1/L)*((int(y,-L,L))*(sin((k*pi*t/L))));
fs = b0+sum(an+bn)
pretty (fs)
Answer:
3.
MANUAL COMPUTATION:
syms x;
a0 = int(pw/(2*pi), [-pi,pi]);
L = pi;
n = 1:10;
k = 1*n;
a = int(pw*cos(k*pi*x/L)/L,x,-L,L);
fs = a0+sum(a.*(cos(k*pi*x/L))+b.*(sin(k*pi*x/L)))
a0 = pi;
L = pi;
n = [1 2 3 4 5 6 7 8 9 10];
k = [1 2 3 4 5 6 7 8 9 10];
a = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
fs = a0+sum(a.*(cos(k*pi*x/L))+b.*(sin(k*pi*x/L)))
pretty (fs)
Answer:
4.
MANUAL COMPUTATION:
syms n t;
L = 4;
a0 = (1/(2*L))*(int(pw, [-4,4]));
n = 1:10;
k = 1*n;
a = int(pw*cos(k*pi*t/L)/L, t, -L, L);
fs = a0+sum(a.*(cos(k*pi*t/L))+b.*(sin(k*pi*t/L)))
pretty (fs)
Answer:
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).
syms x m n o p q r multiplier
multiplier=input('multiplier=');
m=input('m=');
n=input('n=');
o=input('o=');
p=input('p=');
q=input('q=');
r=input('r=');
if m>q
max=m
min=q
else
min=n
max=p
end
if type == 1
pw=multiplier*piecewise(x<m&x>n,o,x<p&x>q,r)
L=max
a0=(1/(2*L))*(int(pw, [min,max]))
k=1:10;
a=(int(pw*cos(k*pi*x/L)/L,x,min,max))
b=(int(pw*sin(k*pi*x/L)/L,x,min,max))
fs=a0+sum(a.*(cos(k*pi*x/L)) + b.*(sin(k*pi*x/L)))
end
if type == 2
f=multiplier;
a0=int(f/(2*L),[min,max])
L=max;
k=1:10;
a=(int(pw*cos(k*pi*x/L)/L,x,min,max));
b=(int(pw*sin(k*pi*x/L)/L,x,min,max));
n
fs=a0+sum(a.*(cos(k*pi*x/L)) + b.*(sin(k*pi*x/L)))
end
Having created this script file, its function is to compute the Fourier Series automatically,
similarly to a calculator. Unlike the first part of the experiment, wherein the script was done to
Experiment 6 has shown that the Fourier Series solves various periodic functions. In addition,
the experiment also explored how to use various methods for the Fourier series using MATLAB.
The experiment is split in two parts. In the first section, a manual computation of the Fourier
series of four different functions was carried out, each of which had different times. For the manual
calculation of the four-function representation of the Fourier series, it is only necessary to know
its mathematical meaning and to perform mathematical operations by hand. These same series
were then carried out and computed using MATLAB. As there is no function that explicitly
performs this procedure, we have performed a sequence of operations that is the same process as
Finally, we also learned to construct an M-file containing the syntax for the Fourier series.
This lets us know how the formula operates within a calculator and helps us to achieve correct
CONCLUSION
This experiment is concerned with the Fourier Series. The objectives were to illustrate the
Fourier series, to evaluate the properties of the periodic wave function using Fourier series, to
demonstrate the use of MATLAB in computing Fourier series, and to create a script file to solve
From the experiment, it was known that the Fourier sequence was an extension of the
periodic function in terms of an infinite number of sines and cosines. The Fourier series uses the
orthogonal correlation of the sine and cosine functions. The Fourier series can be used to promote
the analysis of periodic functions by splitting the periodic functions into a number of simple terms
In summary, the students were able to interpret the Fourier series, evaluate the properties of
the periodic wave function using the Fourier series, demonstrate the use of MATLAB in the
Fourier series, and construct a script file to solve the Fourier series. With this, it can be concluded
MathWorks. (n.d.). MathWorks - Makers of MATLAB and Simulink - MATLAB & Simulink.
https://www.mathworks.com/?s_tid=gn_logo