Soal
TAMBAHAN SOAL NO 2
Jawab
1
Script:
clc;
x=linspace(0, 4*pi,1000);
f=pi/2;
for k=1:1:200
%First Plot Square Wave Function
X=[0, 2*pi, 2*pi, 4*pi, 4*pi];
Y=[0, pi, 0, pi, 0];
f=f-((1/k)*(sin(k*x)));
end
line(x,f)
grid on; hold on;
(x,f)
x=linspace(0, 4*pi,1000);
f=pi/2;
for k=1:1:200
%First Plot Square Wave Function
X=[0, 2*pi, 2*pi, 4*pi, 4*pi];
Y=[0, pi, 0, pi, 0];
f=f-((1/k)*(sin(k*x)));
end
line(x,f)
grid on; hold on;
(x,f)
Output:
2. Transformasi dan Invers Fourier Sinyal sinus dan Sinyal persegi
2.1 Sinyal sinus
clc
subplot(3,1,1);
t=0:.001:2;
x_t=1/2*sin(2*pi*t);
plot(x_t);
axis([-50 2050 -1 1])
subplot(3,1,2);
X_F=fft(x_t);
plot(abs(X_F))
axis([-50 2050 -100 550])
subplot(3,1,3);
x_tt=ifft(X_F);
plot(x_tt)
axis([-50 2050 -1 1])
subplot(3,1,1);
t=0:.001:2;
x_t=1/2*sin(2*pi*t);
plot(x_t);
axis([-50 2050 -1 1])
subplot(3,1,2);
X_F=fft(x_t);
plot(abs(X_F))
axis([-50 2050 -100 550])
subplot(3,1,3);
x_tt=ifft(X_F);
plot(x_tt)
axis([-50 2050 -1 1])
Output
2.2 Sinyal persegi
subplot(3,1,1);
x=[1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0]
stem(x)
title('Sinyal Persegi Dalam Domain Waktu Diskrit');
axis([0 21 -.5 1.5])
subplot(3,1,2);
Xf=fft(x);
stem(abs(Xf));
title('Hasil FFT Sinyal Persegi ke Dalam Domain Frekuensi Diskrit');
axis([0 21 -2 12])
subplot(3,1,3);
xtt=ifft(Xf);
stem(xtt);
title('Hasil Invers FFT Sinyal Persegi ke Dalam Domain Waktu Diskrit');
axis([0 21 -.5 1.5])
x=[1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0]
stem(x)
title('Sinyal Persegi Dalam Domain Waktu Diskrit');
axis([0 21 -.5 1.5])
subplot(3,1,2);
Xf=fft(x);
stem(abs(Xf));
title('Hasil FFT Sinyal Persegi ke Dalam Domain Frekuensi Diskrit');
axis([0 21 -2 12])
subplot(3,1,3);
xtt=ifft(Xf);
stem(xtt);
title('Hasil Invers FFT Sinyal Persegi ke Dalam Domain Waktu Diskrit');
axis([0 21 -.5 1.5])
Output
3 Transformasi Laplace
3.1 Transformasi Laplace
Script:
syms t;
f=(10*sin(4*t))+4*t^2;
laplace(f)
f=(10*sin(4*t))+4*t^2;
laplace(f)
Output:
3.2 Transformasi Laplace
Script:
syms t ;
f=sin(2*t)-sin(4*t)*exp(5*t);
laplace(f)
f=sin(2*t)-sin(4*t)*exp(5*t);
laplace(f)
Output:
3.2 Invers Transformasi Laplace
Script:
syms s;
f=2/((s-5)^2+4)-4/((s-5)^2+16);
ilaplace(f)
f=2/((s-5)^2+4)-4/((s-5)^2+16);
ilaplace(f)
Output: