function varargout = psd(varargin)
% PSD MATLAB code for psd.fig
%
PSD, by itself, creates a new PSD or raises the existing
%
singleton*.
%
% H
= PSD returns the handle to a new PSD or the handle to
%
the existing singleton*.
%
%
PSD('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in PSD.M with the given input arguments.
%
%
PSD('Property','Value',...) creates a new PSD or raises the
%
existing singleton*. Starting
from the left, property value pairs are
%
applied to the GUI before psd_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to
psd_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 psd
% Last Modified by GUIDE v2.5 01-Dec-2019
22:28:57
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton',
gui_Singleton, ...
'gui_OpeningFcn', @psd_OpeningFcn, ...
'gui_OutputFcn',
@psd_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 psd is made
visible.
function psd_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
% buat axes
ah = axes('unit','normalized', 'position', [0 0 1 1]);
%import background
bg = imread('wpp.jpg'); imagesc(bg);
%matikan axes dan tampilkan bagckround
set(ah,'handlevisibility','off','visible','off')
% --- Outputs from this function are returned
to the command line.
function varargout = psd_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)
x=str2num(get(handles.edit1,'String'));
y=str2num(get(handles.edit2,'String'));
axes(handles.axes1)
fs=1000;
N=x;
Wn=y;
[B,A]=butter(N,Wn);
[H,w]=freqz(B,A,N);
len_f=length(H);
f=1/len_f:1/len_f:1;
plot(f,20*log10(abs(H)),'linewidth',2)
% --- 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)
x=str2num(get(handles.edit1,'String'));
y=str2num(get(handles.edit2,'String'));
axes=(handles.axes1);
fs=1000;
N=x;
Wn=y;
[B,A]=butter(N,Wn);
[H,w]=freqz(B,A,N);
len_f=length(H);
f=1/len_f:1/len_f:1;
plot(f,20*log10(abs(H)),'linewidth',2)
% --- 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)
q=str2num(get(handles.edit1,'String'));
y=str2num(get(handles.edit2,'String'));
axes(handles.axes1)
fs=1000;
N=q;
Wn=y;
[B,A]=butter(N,Wn,'high');
[H,w]=freqz(B,A,N);
len_f=length(H);
f=1/len_f:1/len_f:1;
plot(f,20*log10(abs(H)),'linewidth',2)
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)
% 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
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject
handle to slider1 (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,'Value') returns position
of slider
%
get(hObject,'Min') and get(hObject,'Max') to determine range of slider
% --- Executes during object creation, after setting
all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to slider1 (see GCBO)
% eventdata
reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light
gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
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)
set(handles.text7,'string','
Kelompok 2 :SHOLEH HUDIN, MUH ZAINURI, ALMAS FAISAL ')
pause(5)
set(handles.text7,'string','')
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.
%
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: 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
% --- Executes during object creation, after
setting all properties.
function axes2_CreateFcn(hObject, eventdata, handles)
% hObject
handle to axes2 (see GCBO)
% eventdata
reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate
axes2
% --- Executes during object creation, after
setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject
handle to axes1 (see GCBO)
% eventdata
reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate
axes1
called
% --- Executes during object creation, after
setting all properties.
function pushbutton3_CreateFcn(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata
reserved - to be defined in a future version of MATLAB
% handles
empty - handles not created until after all CreateFcns called
% --- Executes on mouse press over axes
background.
function axes1_ButtonDownFcn(hObject, eventdata, handles)
% hObject
handle to axes1 (see GCBO)
% eventdata
reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% --- If Enable == 'on', executes on mouse
press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5
pixel border or over pushbutton3.
function pushbutton3_ButtonDownFcn(hObject, eventdata, handles)
% hObject
handle to pushbutton3 (see GCBO)
% eventdata
reserved - to be defined in a future version of MATLAB
0 komentar:
Posting Komentar