Pengolahan Data Akustik Hasil Pengukuran Laser Induced Breakdown Detection Menggunakan Bahasa Pemrograman Digital

LAMPIRAN
1. Peralatan

2.

Data Sampel

a.

Air murni 3ml
Energy(mj)

Probability Air
Murni

0.07
0.15
0.22
0.3
0.37
0.39

0.82
0.89
1.28
1.42
1.7
2.7
3.5
3.8
4.7
5

0.001
0.003
0.006
0.028
0.045
0.049
0.053
0.065
0.065

0.106
0.154
0.162
0.195
0.198
0.22
0.22

b. 2ml Air Murni + 1 ml Air Kran
Energy
0.07
0.15
0.22
0.3
0.37
0.39
0.82
0.89
1.28
1.42

1.7
2.7
3.5
3.8
4.7
5

Probability
2ml Air murni + 1 ml air Kran
0.001
0.008
0.015
0.044
0.064
0.089
0.097
0.114
0.123
0.144
0.154

0.194
0.22
0.236
0.294
0.312

c. 1 ml Air Murni + 2 ml Air Kran
Energy
0.07
0.15
0.22
0.3
0.37
0.39
0.82
0.89
1.28
1.42
1.7
2.7

3.5
3.8
4.7
5

BD probability
1ml air Murni + 2ml air kran
0.001
0.008
0.015
0.044
0.064
0.074
0.096
0.152
0.157
0.247
0.248
0.344
0.372

0.389
0.395
0.41

d. 3 ml Air Kran
Energy
0.07
0.15
0.22
0.3
0.37
0.39
0.82
0.89
1.28
1.42
1.7
2.7
3.5
3.8

4.7
5

Probability
3ml Air Kran
0.141
0.159
0.205
0.239
0.27
0.275
0.312
0.349
0.373
0.377
0.384
0.406
0.433
0.545
0.545

0.588

e.

3ml Polysterene 330,7.5ppb
Energy
0.07
0.15
0.22
0.3
0.37
0.39
0.82
0.89
1.28
1.42
1.7
2.7
3.5
3.8

4.7
5

f.

Probability
Polysterene
330,7.5ppb
0.015
0.044
0.064
0.074
0.092
0.195
0.29
0.335
0.337
0.338
0.343
0.36

0.415
0.43
0.475
0.591

3ml Polysterene 330,15 ppb
Energy
0.07
0.15
0.22
0.3
0.37
0.39
0.82
0.89
1.28
1.42
1.7
2.7
3.5

3.8
4.7
5

Probability
Polysterene 330,
15ppb
0.29
0.335
0.337
0.343
0.473
0.487
0.503
0.57
0.582
0.634
0.651
0.67
0.681
0.685
0.697
0.727

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',
[]);
if nargin && ischar(varargin{1})

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)
% Get default command line output from handles
structure

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;
hb=hb+1;
end

end
if hb > hitungmin
hitung = hitung +1;
end
hb=0;
end
hitungstr=num2str(hitung);
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:
edit1 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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)
% eventdata reserved - to be defined in a future
version of MATLAB

% handles
structure with handles and user data
(see GUIDATA)
% Hints:
edit2 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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:
edit3 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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)
% 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 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;
hb=hb+1;
end
end
if hb > hitungmin
hitung = hitung +1;
end
hb=0;
end
hitungstr=num2str(hitung);
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:
edit4 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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.
%
See ISPC and COMPUTER.

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:
edit5 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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)
% Hints: get(hObject,'String') returns contents of
edit6 as text

%
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')
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;
hb=hb+1;
end
end
if hb > hitungmin
hitung = hitung +1;
end
hb=0;
end
hitungstr=num2str(hitung);
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:
edit7 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
of edit7 as a double

% --- Executes during object creation, after setting
all properties.

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:
edit8 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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');
end

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:
edit9 as
%
contents

get(hObject,'String') returns contents of
text
str2double(get(hObject,'String')) returns
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)
% hObject
handle to pushbutton5 (see GCBO)

% eventdata reserved - to be defined in a future
version of MATLAB
% handles
structure with handles and user data
(see GUIDATA)
cl = questdlg('Do you want to EXIT?','EXIT',...
'Yes','No','No');
switch cl
case'Yes'
close();
clearall;
return;
case'No'
quitcancel;
end

% --- 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.
function edit10_CreateFcn(hObject, eventdata,
handles)

% 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);
guidata(hObject, handles);