You are on page 1of 6

Mapúa University

Department of EECE

Experiment No. 6
Fourier Series

Name: _Roseus, Aldous Vernon D.____


Course Code / Section: _ECEA106L/B11_

Date of Performance: _December 18, 2019_____


Date of Submission: _January 08, 2019_____

__Prof. Ernesto Vergara__


Instructor
Interpretation of Results

The 6th experiment is entitled Fourier Series, and it has four objectives: (1)
to be able to define the Fourier series (2) to analyze the periodic wave
function characteristics using Fourier series (3) to demonstrate the usage
of MATLAB in computing Fourier series (4) to construct a script file for
solving Fourier series.

In mathematical term, Fourier series is defined to be the expansion of


periodic function with the infinite sum of sines and cosine in wave
components. From the experiment, the problems and questions are
composed of radian forms and degree forms mostly in piecewise functions.
We are tasked to compute and solve for the given functions in Fourier
series manually and using MATLAB software. We were given the formula
used in the experiment.

Fourier series of a 2L periodic function f(x):

where the Fourier coefficients ak (k=1,2,3,…) and bk, k= 1,2,3…, bounded


at [L,-L] are given by:

With the
use of
MATLAB software, piecewise command was utilized in the experiment with
the input “pw”. Using the formula above, the manual computation was
performed. Also, integral function was used with the input command “int”.
From the results, utilizing the ezplot function, the sine waves function will
be displayed by the Fourier series.

Conclusion

To conclude the experiment, we were able to satisfy and achieve the


objectives of the experiment. To check the results, the outcome of the
manual computed functions is the same as the results using the MATLAB
software. Fourier series is indeed an important lesson to learn with both the
manual and software processes. In this experiment, computer generated
application was applied to the functions like the piecewise and the integral
commands. After the experiment, learning the skills and the lessons that
we have learned from Fourier series brought us new knowledge on how
technology can really make our lives easier. The MATLAB software
showed its efficiency and accuracy in finding the Fourier series in the
functions given.

References

 Definition of Fourier Series and Typical Examples. (n.d.). Retrieved


from https://www.math24.net/fourier-series-definition-typical-
examples/?
fbclid=IwAR33O6QPwTpHjPEX0viw3iJUyP0ECrx6JMWfzV0DHmGM
wd6iiuj7iv_Ub4w.
 Fourier Series. (n.d.). Retrieved from https://brilliant.org/wiki/fourier-
series/
 fit. (n.d.). Retrieved from
https://www.mathworks.com/help/curvefit/fourier.html.

Computation and Syntax:

1.)

SYNTAX:

syms x n

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

a0 = (1/(2*L))*(int(pw,[-5,5]))

L=5

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

fs =

(8*sin(pi*n)*cos((pi*n*x)/5))/(n*pi) - (8*sin((pi*n*x)/5)*(cos(pi*n) -
1))/(n*pi) + 4
2.)

SYNTAX:

syms t

k=1*n; L=p ;f2(t)=2*t^2

a0 = (int(f2(t)/(2*L),T,-L,L)

ak = (int(f2(t)*cos(k*pi*t/L)/L,t,-L,L)

bk = (int(f2(t)*sin(k*pi*t/L)/L,t,-L,L)

fs = b0 + sum (ak + bk)

3.)

SYNTAX:

syms t;

n=1:10;

p = 2*(piecewise(t >-pi & t <0,0,t> pi & t <0, sin(t)))

n = 1:5

k = 1*n

a0 = int(p,-L,L)
b0 = a0 *(1/(2*L))

an = (1/L)*(p*(cos((k*pi*x)/L)))

bn = (1/L)*(p*(sin((k*pi*x)/L)))fs = b0 + sum (an + bn)

4.)

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

You might also like