• Tidak ada hasil yang ditemukan

BAB V KESIMPULAN DAN SARAN

5.2 Saran

Tugas akhir ini dapat dikembangkan dengan menggunakan metode

perancangan filter yang lain dan juga menggunakan perancangan filter HPF

(highpass filter) atau BPF (bandpass filter). Selain itu juga dapat dikembangkan

dengan menggunakan algoritma tapis adaptif yang lain seperti algoritma NLMS,

metode domain frekuensi, metode Lattice, metode IIR, dan CMA.

[1] Ifeachor, Emmanuel C., Barrie W. Jervis. Digital Signal Processing. Addison –

Wesley : Great Britain.1993

[2] Proakis, John G., Charles M. Rader, Fuyun Ling, Chrysostomas L. Nikias.

Advanced Digital Signal Processing. Macmillan : United Stated of America.1992

[3] Cavicchi, Thomas J.. Digital Signal Processing. John Wiley & Sons: United

Stated of America.2000

[4] Hayes, Monson H.. Statistical Digital Signal Processing and Modeling. John

Wiley & Sons: United Stated of America.1996

[5] Mitra, Sanjit K. Digital Signal Processing Laboratory Using Matlab. MC Graw –

Hill: United Stated of America. 1999

[6] Widrow, Bernard dan Samuel D. Stearns. Adaptive Signal Processing. Prentice –

Hall Inc: United Stated of America.1985

LAMPIRAN

%

% H = JUDUL returns the handle to a new JUDUL or the handle to % the existing singleton*.

%

% JUDUL('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in JUDUL.M with the given input arguments. %

% JUDUL('Property','Value',...) creates a new JUDUL or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before judul_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to judul_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 judul

% Last Modified by GUIDE v2.5 27-Aug-2007 20:15:08

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @judul_OpeningFcn, ... 'gui_OutputFcn', @judul_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 judul is made visible.

function judul_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 judul (see VARARGIN)

% Choose default command line output for judul

% UIWAIT makes judul wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = judul_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, eventdata, 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)

delete(handles.figure1) sinyal_masukan

% --- 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)

quit = questdlg(['Keluar Program Simulasi Tapis Adaptif?'],... ['Keluar Program'],...

'Ya','Tidak','Tidak'); if strcmp(quit,'Tidak') return;

end

delete(handles.figure1)

% --- 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)

delete(handles.figure1) sinyal_masukan1

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

function figure1_CreateFcn(hObject, eventdata, handles)

% hObject handle to figure1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

function varargout = sinyal_masukan(varargin)

% the existing singleton*. %

% SINYAL_MASUKAN('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in SINYAL_MASUKAN.M with the given input arguments. %

% SINYAL_MASUKAN('Property','Value',...) creates a new SINYAL_MASUKAN or raises the % existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before sinyal_masukan_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to sinyal_masukan_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 sinyal_masukan

% Last Modified by GUIDE v2.5 29-Oct-2007 17:04:52

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @sinyal_masukan_OpeningFcn, ... 'gui_OutputFcn', @sinyal_masukan_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 sinyal_masukan is made visible.

function sinyal_masukan_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 sinyal_masukan (see VARARGIN)

% Choose default command line output for sinyal_masukan

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = sinyal_masukan_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;

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

% --- Executes on button press in pushbutton1.

function pushbutton1_Callback(hObject, eventdata, 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)

set(handles.edit1,'string','');

set(handles.pushbutton2,'enable','off'); set(handles.pushbutton3,'enable','off'); set(handles.pushbutton4,'enable','off'); set(handles.checkbox1,'enable','off'); set(handles.checkbox2,'enable','off'); set(handles.checkbox3,'enable','off'); set(handles.pushbutton12,'enable','off'); set(handles.pushbutton14,'enable','off'); set(handles.pushbutton16,'enable','off');

%Mengambil nama file masukan dari komputer

[nama_file, nama_path]=uigetfile({'*.wav','File WAV (*.wav)'},... 'Buka File Untuk Masukan');

[y,Fs,bits] = wavread(fullfile(nama_path,nama_file)); a=Fs; handles.a=a; b=bits; sk=s(:,1); handles.sk=sk; jumlah_data=length(sk); handles.jumlah_data=jumlah_data; guidata(hObject,handles); else return; end save dtskjumlah_dataab

set(handles.pushbutton2,'enable','on'); set(handles.pushbutton14,'enable','on'); set(handles.edit1,'string',nama_file); set(handles.edit2,'enable','on'); set(handles.edit3,'enable','on');

set(handles.popupmenu1,'enable','on'); set(handles.popupmenu2,'enable','on'); set(handles.checkbox1,'enable','on'); set(handles.checkbox3,'enable','on'); guidata(hObject,handles);

% --- 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)

axes(handles.axes1) stem(handles.sk,'.'); xlabel('Nilai Data ke...') ylabel('Amplitudo') guidata(hObject,handles);

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: 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

set(hObject,'BackgroundColor','white'); end

% --- Executes on selection change in popupmenu1.

function popupmenu1_Callback(hObject, eventdata, handles)

% hObject handle to popupmenu1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu1

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

function popupmenu1_CreateFcn(hObject, eventdata, handles)

% hObject handle to popupmenu1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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)

% 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 checkbox1.

function checkbox1_Callback(hObject, eventdata, handles)

% hObject handle to checkbox1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

nk1=filter(1,ar,nk); handles.nk1=nk1;

guidata(hObject,handles);

set(handles.edit2,'enable','off','string',''); set(handles.edit3,'enable','off','string',''); set(handles.popupmenu1,'enable','off'); set(handles.popupmenu2,'enable','off'); set(handles.checkbox3,'enable','on'); save dt2nknk1

else

set(handles.checkbox3,'enable','on'); set(handles.edit2,'enable','on','string',''); set(handles.edit3,'enable','on','string',''); set(handles.popupmenu1,'enable','on'); set(handles.popupmenu2,'enable','on'); end

% --- Executes on selection change in popupmenu2.

function popupmenu2_Callback(hObject, eventdata, handles)

% hObject handle to popupmenu2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu2

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

function popupmenu2_CreateFcn(hObject, eventdata, handles)

% hObject handle to popupmenu2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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 checkbox2.

function checkbox2_Callback(hObject, eventdata, handles)

% hObject handle to checkbox2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox2

if (get(hObject,'Value') == get(hObject,'Max')) yk=handles.sk+handles.nk1;

handles.yk=yk;

guidata(hObject,handles);

set(handles.pushbutton3,'enable','on'); set(handles.pushbutton16,'enable','on');

set(handles.pushbutton16,'enable','off'); set(handles.pushbutton4,'enable','off'); end

%save dt3 yk

% --- 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)

axes(handles.axes3) stem(handles.yk,'.'); xlabel('Nilai Data ke...') ylabel('Amplitudo') guidata(hObject,handles);

% --- 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) %delete(handles.figure1)

acuanawal

% --- Executes during object deletion, before destroying properties.

function pushbutton1_DeleteFcn(hObject, eventdata, 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)

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

function pushbutton1_CreateFcn(hObject, eventdata, handles)

% hObject handle to pushbutton1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

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

function figure1_CreateFcn(hObject, eventdata, handles)

% hObject handle to figure1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% ---

function OPen_Callback(hObject, eventdata, handles)

% hObject handle to OPen (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% ---

% ---

function Untitled_3_Callback(hObject, eventdata, handles)

% hObject handle to Untitled_3 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% ---

function Untitled_4_Callback(hObject, eventdata, handles)

% hObject handle to Untitled_4 (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)

delete(handles.figure1) judul

% --- 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)

legend toggle

% --- 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)

grid minor

% --- Executes on button press in pushbutton8.

function pushbutton8_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton8 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

datacursormode;

% --- Executes on button press in pushbutton9.

function pushbutton9_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton9 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

zoom

% handles structure with handles and user data (see GUIDATA)

zoom out

pan off

set(handles.pushbutton11,'enable','off');

% --- Executes on button press in pushbutton11.

function pushbutton11_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton11 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

pan

% --- Executes on button press in pushbutton12.

function pushbutton12_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton12 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max')) axes(handles.axes2)

stem(handles.nk1,'.'); xlabel('Nilai Data ke...') ylabel('Amplitudo') guidata(hObject,handles); else

axes(handles.axes2)

stem(handles.t,handles.nk1,'fill','.'); xlabel('Nilai Data ke...')

ylabel('Amplitudo') guidata(hObject,handles); end

% --- Executes on button press in checkbox3.

function checkbox3_Callback(hObject, eventdata, handles)

% hObject handle to checkbox3 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox3

if (get(hObject,'Value') == get(hObject,'Max'))

if ((str2double(get(handles.edit2,'string'))) >0 )&((str2double(get(handles.edit3,'string'))) >0 ) amp=konversi1(str2double(get(handles.edit2,'string')),get(handles.popupmenu1,'value')); frek=konversi(str2double(get(handles.edit3,'string')),get(handles.popupmenu2,'value')); [nk1,t]=sinus(amp,frek);

set(handles.pushbutton12,'enable','on'); set(handles.checkbox2,'enable','on'); set(handles.pushbutton15,'enable','on'); handles.nk1=nk1;

handles.t=t;

guidata(hObject,handles); save dt2nk1

set(handles.checkbox2,'enable','off');

errordlg('Amplitudo harus lebih besar dari 0 dan Range frekuensi berkisar 1Hz - 1MHz','Error','modal');

return; else

set(handles.pushbutton12,'enable','on'); set(handles.pushbutton15,'enable','on'); set(handles.checkbox2,'enable','on'); end

elseif (get(hObject,'Value') == get(hObject,'Min')) set(handles.pushbutton12,'enable','off'); set(handles.pushbutton15,'enable','off'); set(handles.checkbox2,'enable','off'); end

% --- Executes on button press in pushbutton14.

function pushbutton14_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton14 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

wavplay(handles.sk);

% --- Executes on button press in pushbutton15.

function pushbutton15_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton15 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

wavplay(handles.nk1);

% --- Executes on button press in pushbutton16.

function pushbutton16_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton16 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

wavplay(handles.yk);

% ---

function Bantuan_Callback(hObject, eventdata, handles)

% hObject handle to Bantuan (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

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

function uipanel10_CreateFcn(hObject, eventdata, handles)

% hObject handle to uipanel10 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% ---

function help_Callback(hObject, eventdata, handles)

% ---

function jelas_Callback(hObject, eventdata, handles)

% hObject handle to jelas (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

penjelasan

% ---

function keluar_Callback(hObject, eventdata, handles)

% hObject handle to keluar (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

pilihan = questdlg(['Keluar ',get(handles.figure1,'Name') ' ?'],... ['Keluar ',get(handles.figure1,'Name') '...'],...

'Ya','Tidak','Ya'); if strcmp(pilihan,'Tidak') return;

end

delete(handles.figure1)

% ---

function menu_Callback(hObject, eventdata, handles)

% hObject handle to menu (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 pushbutton17.

function pushbutton17_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton17 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

quit = questdlg(['Keluar ',get(handles.figure1,'name') ' ?'],... ['Keluar ',get(handles.figure1,'name') '...'],...

'Ya','Tidak','Tidak'); if strcmp(quit,'Tidak') return;

end

delete(handles.figure1)

function varargout = acuanawal(varargin)

% ACUANAWAL M-file for acuanawal.fig

% ACUANAWAL, by itself, creates a new ACUANAWAL or raises the existing % singleton*.

%

% H = ACUANAWAL returns the handle to a new ACUANAWAL or the handle to % the existing singleton*.

%

% ACUANAWAL('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in ACUANAWAL.M with the given input arguments. %

%

% *See GUI Options on GUIDE's Tools file. Choose "GUI allows only one % instance to run (singleton)".

%

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help acuanawal

% Last Modified by GUIDE v2.5 29-Oct-2007 16:47:53

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @acuanawal_OpeningFcn, ... 'gui_OutputFcn', @acuanawal_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 acuanawal is made visible.

function acuanawal_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 acuanawal (see VARARGIN)

% Choose default command line output for acuanawal

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes acuanawal wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = acuanawal_OutputFcn(hObject, eventdata, handles)

% Get default command line output from handles structure

varargout{1} = handles.output;

% --- Executes on button press in checkbox1.

function checkbox1_Callback(hObject, eventdata, handles)

% hObject handle to checkbox1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkbox1

load dt

if (get(hObject,'Value') == get(hObject,'Max')) xk=0.8*randn(jumlah_data,1);

ma=[1,-0.8,0.4,-0.2]; xk1=filter(ma,1,xk); handles.xk1=xk1;

guidata(hObject,handles);

set(handles.edit2,'enable','off','string',''); set(handles.edit1,'enable','off','string',''); set(handles.popupmenu1,'enable','off'); set(handles.popupmenu2,'enable','off'); save dt4xkxk1

else

set(handles.edit2,'enable','on','string',''); set(handles.edit1,'enable','on','string',''); set(handles.popupmenu1,'enable','on'); set(handles.popupmenu2,'enable','on'); end

% --- Executes on selection change in popupmenu1.

function popupmenu1_Callback(hObject, eventdata, handles)

% hObject handle to popupmenu1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu1

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

function popupmenu1_CreateFcn(hObject, eventdata, handles)

% hObject handle to popupmenu1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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');

% handles structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu2

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

function popupmenu2_CreateFcn(hObject, eventdata, handles)

% hObject handle to popupmenu2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu 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: 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 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

Dokumen terkait