Вы находитесь на странице: 1из 3

Name/Surname: Buşra Nur Yüceur

Student ID: 14960021

Mechanical Vibrations – UUS 304E

Homework #1

(First define the problem, write down what is given, the quantities to be calculated.)

Solution

The Signal function:


𝑔(𝑥) = ⋯

The Fourier function:



𝑛𝜋𝑥 𝑛𝜋𝑥
𝑓(𝑥) = 𝑎0 + ∑ (𝑎𝑛 cos + 𝑏𝑛 sin )
𝐿 𝐿
𝑛=1
Where
1 𝜋
𝑎0 = ∫ 𝑓(𝑥)𝑑𝑥
𝜋 −𝜋
1 𝜋
𝑎𝑛 = ∫ 𝑓(𝑥) cos(𝑛𝑥) 𝑑𝑥
𝜋 −𝜋
1 𝜋
𝑏𝑛 = ∫ 𝑓(𝑥) sin(𝑛𝑥) 𝑑𝑥
𝜋 −𝜋
and n=1, 2, 3, ....

(The above equations are given as samples. Using word equation tools, write your own Fourier series
approximation and signal function.)
Source Code:
N = 100000;
Wo = pi/5;
t = -1:.001:11;
f = zeros(1,length(t));

for n = 1:2:N
an = 4/(pi*n);
f = f+ an*sin(Wo*n*t);
end

plot(t,f)
axis([-1 11 -1.1 1.1])
title(['Fourier Series Representation w/ ' num2str(N) '
Terms'],'FontSize',16)
xlabel('Time')
ylabel('Function Value')

Вам также может понравиться