You are on page 1of 25

School of Electrical Engineering, Electronics

Engineering, and Computer Engineering

Laboratory Experiment Report Rubric

NAME OF STUDENT: DATE SUBMITTED:

GALON, Meridith Lindsey Q. 28 - 01 - 2021

EXPERIMENT TITLE EVALUATOR:

ENGR. ERNESTO M. VERGARA JR.


Fourier Series

Poor Fair Good Very Good Excellent


Criteria Score
(1) (2) (3) (4) (5)
A. Completeness The laboratory report The laboratory report The laboratory report The laboratory report The laboratory report
and organization is untidy, did not follow is untidy, followed the is neat, followed the is neat, followed the is very neat, well
of the Experiment the given format, given format, some given format, some given format, no presented, followed
some parts are parts are missing, parts are missing, missing parts, and the given format,
Laboratory
missing, most most questions are not mostly questions are only a few questions organized, and the
Report questions are not answered. not answered. are not answered. required content is
answered. complete.
The result, gathered The result is correct, The result and The result and The result, gathered
data, and answers to however, gathered gathered data were gathered data were all data, and answers to
questions were all data, and answers to correct, however, correct, and most of questions are all
incorrect. If data questions were all answers to questions the answers to correct. If data sheets
B. Correctness of sheets are required in incorrect. If data were all incorrect. If questions are all are required in the
the gathered data the experiment, they sheets are required in data sheets are correct. If data sheets experiment, data
are not used. the experiment, data required in the are required in the sheets are fully
and answers to
sheets are used but experiment, data experiment, data consulted and correct
questions. wrong data are used sheets are consulted sheets are consulted data are used in the
in the computation or but some of the data but with few wrong tabulation or
tabulated. used are wrong. data used in the computation.
computation or
tabulation.

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

GALON, Meridith Lindsey Q.


Name:__________________________________ Date:_____________________
Course & Section:_________________________ 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.

The Fourier series of a periodic function f(x) is given by

where the Fourier coefficients ak, k = 1,2,3,....., and bk, k = 1,2,3,....., bounded at [-L,L], are given by
, , and

The nth partial sum of the Fourier series is

Example1.

; period =10

Solution
Matlab Command:

>> syms x
>> pw = piecewise(x>0 & x<5, 4, x>-5 & x<0, -4)

pw =

piecewise(x in Dom::Interval(0, 5), 4, x in Dom::Interval(-5, 0), -4)

>> 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=

[ 16/pi, 0, 16/(3*pi), 0, 16/(5*pi), 0, 16/(7*pi), 0, 16/(9*pi), 0]

>> fs = a0 + sum(a.*(cos(k*pi*x/L)) + b.*(sin(k*pi*x/L)))

fs =

(16*sin(pi*x))/(5*pi) + (16*sin((pi*x)/5))/pi + (16*sin((3*pi*x)/5))/(3*pi) + (16*sin((7*pi*x)/5))/(7*pi) +


(16*sin((9*pi*x)/5))/(9*pi)

Example 2.
Find the fourier series of

f(x) = |x|, [-1,1]; period = 2

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=

[ -4/pi^2, 0, -4/(9*pi^2), 0, -4/(25*pi^2), 0, -4/(49*pi^2), 0, -4/(81*pi^2), 0]

>> b = int(f*sin(k*pi*x/L)/L,x,-L,L)

b=

[ 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)))

fs =

1/2 - (4*cos(3*pi*x))/(9*pi^2) - (4*cos(5*pi*x))/(25*pi^2) - (4*cos(7*pi*x))/(49*pi^2) -


(4*cos(9*pi*x))/(81*pi^2) - (4*cos(pi*x))/pi^2

> 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).

MATLAB COMMAND/ SYNTAX:


__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
__________________________________________________________________________________________
SIMULATION RESULTS IN MATHLAB

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

pw = 2*(piecewise(x>-5 & x<0, 0, x>0 & x<5, 4));

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:

MATHLAB COMMAND/ SYNTAX:

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:

MATHLAB COMMAND/ SYNTAX:

syms x;

pw = 2*piecewise(x>-pi & x<0, 0, x>0 & x<pi, pi);

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)))

pw = piecewise(x>-pi & x<0, 0, x>0 & x<pi, 2*pi);

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];

b = [ 4, 0, 4/3, 0, 4/5, 0, 4/7, 0, 4/9, 0];

fs = a0+sum(a.*(cos(k*pi*x/L))+b.*(sin(k*pi*x/L)))

pretty (fs)

Answer:
4.

MANUAL COMPUTATION:

MATHLAB COMMAND/ SYNTAX:

syms n t;

pw = 3*piecewise(t>-4 & t<0, -t, t>0 & t<4, 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);

b = int(pw*sin(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).

MATHLAB COMMAND/ SYNTAX:

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=');

type=input('if piecewise type 1, if function type 2 ');

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

satisfy a specific Fourier Series.


INTERPRETATION OF RESULTS

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

the Fourier series manually.

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

answers within a limited amount of time.

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

Fourier series. These were all encountered in the experiment.

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

that are more commonly recognized in the study of mathematics.

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

that the experiment is a success.


REFERENCES

MathWorks. (n.d.). MathWorks - Makers of MATLAB and Simulink - MATLAB & Simulink.

https://www.mathworks.com/?s_tid=gn_logo

You might also like