LAMPIRAN
2.
Data Sampel
a. Air murni 3ml
Energy(mj) Probability Air Murni
Energy Probability
c. 1 ml Air Murni + 2 ml Air Kran
Energy BD probability
1ml air Murni + 2ml air kran
0.07 0.001
0.15 0.008
0.22 0.015
0.3 0.044
0.37 0.064
0.39 0.074
0.82 0.096
0.89 0.152
1.28 0.157
1.42 0.247
1.7 0.248
2.7 0.344
3.5 0.372
3.8 0.389
4.7 0.395
5 0.41
d. 3 ml Air Kran
Energy Probability 3ml Air Kran 0.07 0.141
0.15 0.159
0.22 0.205
0.3 0.239
0.37 0.27
0.39 0.275
0.82 0.312
0.89 0.349
1.28 0.373
1.42 0.377
1.7 0.384
2.7 0.406
3.5 0.433
3.8 0.545
4.7 0.545
e. 3ml Polysterene 330,7.5ppb Polysterene 330,
3.
Program
function varargout = baru05(varargin) % BARU05 M-file for baru05.fig
% BARU05, by itself, creates a new BARU05 or raises the existing
% singleton*. %
% H = BARU05 returns the handle to a new BARU05 or the handle to
% the existing singleton*. %
%
BARU05('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BARU05.M with the given input arguments.
%
% BARU05('Property','Value',...) creates a new BARU05 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before baru05_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to baru05_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)". %
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help baru05
% Last Modified by GUIDE v2.5 28-Apr-2015 15:23:57
% Begin initialization code - DO NOT EDIT gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @baru05_OpeningFcn, ...
'gui_OutputFcn', @baru05_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before baru05 is made visible.
function baru05_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn. % hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to baru05 (see VARARGIN)
% Choose default command line output for baru05 handles.output = hObject;
% Update handles structure guidata(hObject, handles);
% UIWAIT makes baru05 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = baru05_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, ~, handles) % hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
threshold =str2num(get(handles.edit2,'string'));
[filename,pathname] = uigetfile({'*.wav'});
if ~isequal(filename,0)
[x,fs] = wavread([pathname '/' filename]);
else return end
set(handles.edit1,'String',filename);
signal1=x;
signal2 = signal1; handles.x = signal1; axes(handles.axes2); plot(signal1);
title('SINYAL SUARA');
xlabel('ENERGY');
ylabel('BD PROBABILITY')
hitung = 0; hitungmin = 1;
%treshold signal %threshold = 0.12; jd = length(signal1); dx = 4410;
jb=floor(jd/dx); hb=0;
for m = 1:jd
if signal2(m)<threshold
signal2 (m) = 0;
end end
axes(handles.axes3); plot(signal2);
title('HASIL THRESHOLD');
guidata(hObject, handles);
for m = 1 : jb
for i = 1 : dx
if signal1 ((m-1)*dx + i) > threshold;
hb=hb+1;
end
set(handles.edit3,'string',hitungstr); %
guidata(hObject, handles); display(hitung);
function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO)
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
threshold =str2num(get(handles.edit5,'string'));
[filename,pathname] = uigetfile({'*.wav'});
if ~isequal(filename,0)
[x,fs] = wavread([pathname '/' filename]);
else return end
set(handles.edit4,'String',filename);
signal1=x;
signal2 = signal1; handles.x = signal1; axes(handles.axes4); plot(signal1);
title('SINYAL SUARA');
xlabel('ENERGY');
ylabel('BD PROBABILITY')
hitung = 0; hitungmin = 1;
%treshold signal %threshold = 0.12; jd = length(signal1); dx = 4410;
jb=floor(jd/dx); hb=0;
for m = 1:jd
if signal2(m)<threshold
signal2 (m) = 0;
end
axes(handles.axes5);
title('HASIL THRESHOLD');
plot(signal2);
guidata(hObject, handles);
for m = 1 : jb
set(handles.edit6,'string',hitungstr); %
guidata(hObject, handles); display(hitung);
function edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit5_Callback(hObject, eventdata, handles) % hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit5 as text
% str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit6_Callback(hObject, eventdata, handles) % hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
threshold =str2num(get(handles.edit8,'string'));
[filename,pathname] = uigetfile({'*.wav'});
if ~isequal(filename,0)
[x,fs] = wavread([pathname '/' filename]);
else return end
set(handles.edit7,'String',filename);
signal1=x;
signal2 = signal1; handles.x = signal1; axes(handles.axes6); plot(signal1);
title('SINYAL SUARA');
xlabel('ENERGY');
ylabel('BD PROBABILITY')
%treshold signal %threshold = 0.12; jd = length(signal1); dx = 4410;
jb=floor(jd/dx); hb=0;
for m = 1:jd
if signal2(m)<threshold
signal2 (m) = 0;
end end
axes(handles.axes7);
title('HASIL THRESHOLD');
plot(signal2);
guidata(hObject, handles);
for m = 1 : jb
set(handles.edit9,'string',hitungstr); %
guidata(hObject, handles); display(hitung);
function edit7_Callback(hObject, eventdata, handles) % hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit7 as text
% str2double(get(hObject,'String')) returns contents of edit7 as a double
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit8_Callback(hObject, eventdata, handles) % hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit8 as text
% str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
function edit9_Callback(hObject, eventdata, handles) % hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit9 as text
% str2double(get(hObject,'String')) returns contents of edit9 as a double
% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x=str2num(get(handles.edit3,'string'));
y=str2num(get(handles.edit6,'string'));
z=str2num(get(handles.edit9,'string'));
jumlah=((x+y+z)/3)/1000;
set(handles.edit10,'String', jumlah);
guidata(hObject, handles);
function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit10 as text
% str2double(get(hObject,'String')) returns contents of edit10 as a double
% --- Executes during object creation, after setting all properties.
% hObject handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
threshold=str2num(get(handles.edit2,'string'));
set(handles.edit2,'String', threshold);