Professional Documents
Culture Documents
Department of EECE
Experiment No. 6
Fourier Series
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.
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
References
1.)
SYNTAX:
syms x n
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
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)
3.)
SYNTAX:
syms t;
n=1:10;
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)))
4.)
SYNTAX:
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))
>> b = int(pw*sin(k*pi*t/L)/L,t,-L,L)