You are on page 1of 6

Welly Ikawijaya

38458
Laporan Praktikum Pengolahan Isyarat Digital
Unit 2



Percobaan 1



close all; clear all; clc;
t=0:0.01:5;
n=0:500;
Ts=.01;
xt = 2 + cos(10*t);
xn1 = 2;
xn2 = cos(10*n*Ts);
xn= xn1 + xn2;
h=figure('color', [1 1 1]);
subplot(3,1,1); plot(t,xt);
for N=2:4:6
if (N<3) farbe='b';
else farbe='--r';
end
[numz,denz] = butter(N, (10/(2*pi))*(1/2*Ts));
[H, f] = freqz(numz, denz);
subplot(3,1,2);
plot(f/pi, abs(H),farbe);
hold on;
yn = filter(numz,denz,xn);
subplot(3,1,3);
plot(n*Ts,yn,farbe);
hold on;
end
title('the signal after cos(10*t) term is removed');
xlabel('time (s)');
subplot(3,1,2); legend('orde 2','orde 6'), axis([0 1 0 1.01]);
subplot(3,1,3); axis([0 5 0 3]);


















Hasil




























Percobaan 2



clear all;
[y, fs, nbits] = wavread('welly.wav'); %read in the wav
%sound(y,fs) %play back the wav
tt=length(y);
t=1:tt;
plot(t,y) %plot the original waveform
grid
values=100/(fs/2);
[b,a]=butter(6,values,'low');
low_pass=filter(b,a,y);
sound(low_pass,fs)
figure(2)
w=[0:0.1:100];
sys=tf(b,a)
bode(sys,w)
figure(3)
ttt=length(low_pass);
t=1:ttt;
plot(t,low_pass) %plot the original waveform
grid
figure(4)
w=[0:0.1:100];
h1=freqs(b,a,w);
plot(w,20*log10(abs(h1)));

You might also like