function varargout = gui(varargin)
% GUI M-file for gui.fig
% GUI, by itself, creates a new GUI or raises the existing
% singleton*.
%
% H = GUI returns the handle to a new GUI or the handle to
% the existing singleton*.
%
% GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI.M with the given input arguments.
%
% GUI('Property','Value',...) creates a new GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before gui_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to gui_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 gui
% Last Modified by GUIDE v2.5 01-Aug-2005 01:50:32
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @gui_OpeningFcn, ...
'gui_OutputFcn', @gui_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(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 gui is made visible.
function gui_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 gui (see VARARGIN)
% Choose default command line output for gui
handles.output = hObject;
% Make the FFT Radio Button Active...
set(handles.FFTradio,'Value',1);
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = gui_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 b1.
function b1_Callback(hObject, eventdata, handles)
% hObject handle to b1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(1);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b2.
function b2_Callback(hObject, eventdata, handles)
% hObject handle to b2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(2);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b3.
function b3_Callback(hObject, eventdata, handles)
% hObject handle to b3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(3);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b4.
function b4_Callback(hObject, eventdata, handles)
% hObject handle to b4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(4);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b5.
function b5_Callback(hObject, eventdata, handles)
% hObject handle to b5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(5);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b6.
function b6_Callback(hObject, eventdata, handles)
% hObject handle to b6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(6);
algo=get(handles.FFTradio, 'Value');
update_gui
%--- Executes on button press in b7.
function b7_Callback(hObject, eventdata, handles)
% hObject handle to b7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(7);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b8.
function b8_Callback(hObject, eventdata, handles)
% hObject handle to b8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(8);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b9.
function b9_Callback(hObject, eventdata, handles)
% hObject handle to b9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(9);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in ba.
function bstar_Callback(hObject, eventdata, handles)
% hObject handle to bstar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad('*');
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in b0.
function b0_Callback(hObject, eventdata, handles)
% hObject handle to b0 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad(0);
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in bn.
function bcell_Callback(hObject, eventdata, handles)
% hObject handle to bcell (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[n,signal]=phone_pad('#');
algo=get(handles.FFTradio, 'Value');
update_gui
% --- Executes on button press in info.
function info_Callback(hObject, eventdata, handles)
% hObject handle to info (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
msgbox('File was created by: Zouzias Anastasios CEID University of Patras Greece','Info','warn')
% --- Executes on button press in close.
function close_Callback(hObject, eventdata, handles)
% hObject handle to close (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close;
% --- Executes on mouse press over axes background.
function fig1_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to fig1 (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 GoertzelRadio.
function GoertzelRadio_Callback(hObject, eventdata, handles)
% hObject handle to GoertzelRadio (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 GoertzelRadio
state=get(hObject, 'Value');
if state==0,
set(hObject, 'Value', 1);
else,
set(handles.FFTradio, 'Value', 0);
% states=ones(23, 1);states([(3:10)])=0;
% handles=activate_uicontrol(states, handles);
end
guidata(hObject, handles);
% --- Executes on button press in FFTradio.
function FFTradio_Callback(hObject, eventdata, handles)
% hObject handle to FFTradio (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 FFTradio
state=get(hObject, 'Value');
if state==0,
set(hObject, 'Value', 1);
else,
set(handles.GoertzelRadio, 'Value', 0);
% states=ones(23, 1);states([(3:10)])=0;
% handles=activate_uicontrol(states, handles);
end
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function EditPressed_CreateFcn(hObject, eventdata, handles)
% hObject handle to EditPressed (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function EditPressed_Callback(hObject, eventdata, handles)
% hObject handle to EditPressed (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 EditPressed as text
% str2double(get(hObject,'String')) returns contents of EditPressed as a double