Sie sind auf Seite 1von 11

UAS PRAKTIKUM

PENGOLAHAN SINYAL DIGITAL


Nama : Vidri Lukika D
NIM : 121107071
Teknik Elektro
Sains Dan Teknologi
Universitas Islam Negri
Sunan unung D!ati
201"
Sour#e $ode
% --- Executes on button press in open.
function open_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x
fs$%%!&&'
(filena)e,pathna)e*$uietfile(+,.-av+, +.ilih /av 0ile+)'
(sinal,fs*$-avread((pathna)e,filena)e*)'
sinal$&.11,sinal2)ax(abs(sinal))'
fiure (!)'
subplot (",!,!)'
hold on'
plot (sinal)'
title (+Oriinal 3inal+)'
rid on
% hObject handle to open (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in pla=.
function pla=_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'

!$et(handles.slider!,+value+)'
"$et(handles.slider",+value+)'
>$et(handles.slider>,+value+)'

ain!$!&?(!2!&)'
ain"$!&?("2!&)'
ain>$!&?(>2!&)'

lpf$fir!(@&,fc!2(fs2"))'
bpf$fir!(@&,(fc!,fc"*2(fs2"))'
hpf$fir!(@&,fc"2(fs2"),+hih+)'

x!$ain!,filter(lpf,!,sinal)'
x"$ain",filter(bpf,!,sinal)'
x>$ain>,filter(hpf,!,sinal)'

x$(x!Ax"Ax>)2>'

-avpla=(x,fs)
fiure(!)'
subplot(",!,")'
plot (x)'
title (+Basil 0;C 0;98EC+)'
rid on
% hObject handle to pla= (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)



function fca_Callback(hObject, eventdata, handles)
% hObject handle to fca (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)

% BintsD et(hObject,+3trin+) returns contents of fca as text
% str"double(et(hObject,+3trin+)) returns contents of fca as a
double


% --- Executes durin object creation, after settin all properties.
function fca_Create0cn(hObject, eventdata, handles)
% hObject handle to fca (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles e)pt= - handles not created until after all Create0cns called

% BintD edit controls usuall= have a -hite backround on /indo-s.
% 3ee ;3.C and CO6.:8EC.
if ispc EE iseFual(et(hObject,+5ackroundColor+),
et(&,+default:icontrol5ackroundColor+))
set(hObject,+5ackroundColor+,+-hite+)'
end



function fcb_Callback(hObject, eventdata, handles)
% hObject handle to fcb (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)

% BintsD et(hObject,+3trin+) returns contents of fcb as text
% str"double(et(hObject,+3trin+)) returns contents of fcb as a
double


% --- Executes durin object creation, after settin all properties.
function fcb_Create0cn(hObject, eventdata, handles)
% hObject handle to fcb (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles e)pt= - handles not created until after all Create0cns called

% BintD edit controls usuall= have a -hite backround on /indo-s.
% 3ee ;3.C and CO6.:8EC.
if ispc EE iseFual(et(hObject,+5ackroundColor+),
et(&,+default:icontrol5ackroundColor+))
set(hObject,+5ackroundColor+,+-hite+)'
end



function orde_Callback(hObject, eventdata, handles)
% hObject handle to orde (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)

% BintsD et(hObject,+3trin+) returns contents of orde as text
% str"double(et(hObject,+3trin+)) returns contents of orde as a
double


% --- Executes durin object creation, after settin all properties.
function orde_Create0cn(hObject, eventdata, handles)
% hObject handle to orde (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles e)pt= - handles not created until after all Create0cns called

% BintD edit controls usuall= have a -hite backround on /indo-s.
% 3ee ;3.C and CO6.:8EC.
if ispc EE iseFual(et(hObject,+5ackroundColor+),
et(&,+default:icontrol5ackroundColor+))
set(hObject,+5ackroundColor+,+-hite+)'
end


% --- Executes on slider )ove)ent.
function slider!_Callback(hObject, eventdata, handles)
% hObject handle to slider! (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)

% BintsD et(hObject,+Galue+) returns position of slider
% et(hObject,+6in+) and et(hObject,+6ax+) to deter)ine rane of
slider


% --- Executes durin object creation, after settin all properties.
function slider!_Create0cn(hObject, eventdata, handles)
% hObject handle to slider! (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles e)pt= - handles not created until after all Create0cns called

% BintD slider controls usuall= have a liht ra= backround.
if iseFual(et(hObject,+5ackroundColor+),
et(&,+default:icontrol5ackroundColor+))
set(hObject,+5ackroundColor+,(.1 .1 .1*)'
end


% --- Executes on slider )ove)ent.
function slider"_Callback(hObject, eventdata, handles)
% hObject handle to slider" (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)

% BintsD et(hObject,+Galue+) returns position of slider
% et(hObject,+6in+) and et(hObject,+6ax+) to deter)ine rane of
slider


% --- Executes durin object creation, after settin all properties.
function slider"_Create0cn(hObject, eventdata, handles)
% hObject handle to slider" (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles e)pt= - handles not created until after all Create0cns called

% BintD slider controls usuall= have a liht ra= backround.
if iseFual(et(hObject,+5ackroundColor+),
et(&,+default:icontrol5ackroundColor+))
set(hObject,+5ackroundColor+,(.1 .1 .1*)'
end


% --- Executes on slider )ove)ent.
function slider>_Callback(hObject, eventdata, handles)
% hObject handle to slider> (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)

% BintsD et(hObject,+Galue+) returns position of slider
% et(hObject,+6in+) and et(hObject,+6ax+) to deter)ine rane of
slider


% --- Executes durin object creation, after settin all properties.
function slider>_Create0cn(hObject, eventdata, handles)
% hObject handle to slider> (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles e)pt= - handles not created until after all Create0cns called

% BintD slider controls usuall= have a liht ra= backround.
if iseFual(et(hObject,+5ackroundColor+),
et(&,+default:icontrol5ackroundColor+))
set(hObject,+5ackroundColor+,(.1 .1 .1*)'
end


% --- Executes on button press in lpf>.
function lpf>_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc"2(fs2")'
lpf$ellip(#,!,!&&,/n,+lo-+)'
hasil$filter(lpf,!,sinal)'

-avpla=(hasil,fs)'
fiure(!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter 9.0 Ellipstic+)'
rid on
fiure, freFH(hasil)
% hObject handle to lpf> (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in bpf>.
function bpf>_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc"2(fs2")'
bpf$ellip(#,!,!&&,/n,+bandpass+)'
hasil$filter(bpf,!,sinal)'

-avpla=(hasil,fs)'
fiure(!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter 5.0 Elliptic+)'
rid on
fiure, freFH(hasil)
% hObject handle to bpf> (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in hpf>.
function hpf>_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc"2(fs2")'
hpf$ellip(#,!,!&&,/n,+hih+)'
hasil$filter(hpf,!,sinal)'

-avpla=(hasil,fs)'
fiure(!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter B.0 Elliptic+)'
rid on
fiure, freFH(hasil)
% hObject handle to hpf> (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in lpf".
function lpf"_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc!2(fs2")'
lpf$cheb=!(#,!,/n)'
hasil$filter(lpf,!,sinal)'

-avpla=(hasil,fs)'
fiure (!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter 9.0 5utter-orth+)'
rid on
fiure, freFH(hasil)
% hObject handle to lpf" (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in bpf".
function bpf"_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$((fc!,fc"*2(fs2"))'
bpf$cheb=!(#,!,/n,+bandpass+)'
hasil$filter(bpf,!,sinal)'
-avpla=(hasil,fs)'

fiure(!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter 5.0 Cheb=shev+)'
rid on
fiure, freFH(hasil)
% hObject handle to bpf" (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in hpf".
function hpf"_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc"2(fs2")'
hpf$cheb=!(#,!,/n,+hih+)'
hasil$filter(hpf,!,sinal)'

-avpla=(hasil,fs)'
fiure(!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter B.0 Cheb=shev+)'
rid on
fiure, freFH(hasil)
% hObject handle to hpf" (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in lpf".
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to lpf" (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in bpf!.
function bpf!_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$((fc!,fc"*2(fs2"))'
bpf$butter(#,/n,+bandpass+)'
hasil$filter(bpf,!,sinal)'

-avpla=(hasil,fs)'
fiure (!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter 5.0 5utter-orth+)'
rid on
fiure, freFH(hasil)
% hObject handle to bpf! (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in hpf!.
function hpf!_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil x

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc"2(fs2")'
hpf$butter(#,/n,+hih+)'
hasil$filter(hpf,!,sinal)'

-avpla=(hasil,fs)'
fiure (!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter B.0 5utter-orth+)'
rid on
fiure, freFH(hasil)
% hObject handle to hpf! (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in lpf!.
function lpf!_Callback(hObject, eventdata, handles)
lobal sinal fs fc! fc" # #! hasil

fcsatu $ et(handles.fca,+strin+)'
fcdua $ et(handles.fcb,+strin+)'
#! $ et(handles.orde,+strin+)'

fc!$str"nu)(fcsatu)'
fc"$str"nu)(fcdua)'
#$str"nu)(#!)'

/n$fc!2(fs2")'
lpf$butter(#,/n,+lo-+)'
hasil$filter(lpf,!,sinal)'

-avpla=(hasil,fs)'
fiure (!)'
subplot(",!,")'
plot(hasil)'
title (+Basil 0ilter 9.0 5utter-orth+)'
rid on
fiure, freFH(hasil)
% hObject handle to lpf! (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)


% --- Executes on button press in save.
function save_Callback(hObject, eventdata, handles)
% hObject handle to save (see 4C5O)
% eventdata reserved - to be defined in a future version of 678975
% handles structure -ith handles and user data (see 4:;<787)
Desain Gambar GUI Filter IIR dan Filter FIR
Analisis :
Pada program di atas yaitu flter FIR dan IIR menurut saya suara bisa
terdengar dengan menggunakan flter FIR dengan menggunakan LPF yaitu
meloloskan frekuensi rendah .
Dan pada Filter IIR menggunakan ButterWorth dengan BPF karena
menurut saya dengan menggunakan flter ini suara bisa terdengan dan
tidak terlalu bising.tetapi suara tidak bisa terdengar jelas.
asil audio berupa kata!kata "halo #aka$%elamat &engerjakan ...." suara
berikut yang hanya bisa terdengar dan seterusnya suara tidak bisa
terdengar 'noise terlalu banyak(.

Das könnte Ihnen auch gefallen