gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/lpc/lpcexpo.m

    function varargout = lpcexpo(varargin)
% LPCEXPO M-file for lpcexpo.fig
%      LPCEXPO, by itself, creates a new LPCEXPO or raises the existing
%      singleton*.
%
%      H = LPCEXPO returns the handle to a new LPCEXPO or the handle to
%      the existing singleton*.
%
%      LPCEXPO('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in LPCEXPO.M with the given input arguments.
%
%      LPCEXPO('Property','Value',...) creates a new LPCEXPO or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before lpcexpo_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to lpcexpo_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 lpcexpo

% Last Modified by GUIDE v2.5 21-May-2004 08:59:08

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @lpcexpo_OpeningFcn, ...
                   'gui_OutputFcn',  @lpcexpo_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 lpcexpo is made visible.
function lpcexpo_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 lpcexpo (see VARARGIN)

% Choose default command line output for lpcexpo
	handles.output = hObject;
	guidata(hObject, handles);
	set(gcf,'UserData',handles);
	lpcexpofn;

% This sets up the initial plot - only do when we are invisible
% so window can get raised using lpcexpo.
if (nargin > 3)
	datastruct = varargin{1};
	lpcexpofn('readinput',datastruct);
end

% --- Outputs from this function are returned to the command line.
function varargout = lpcexpo_OutputFcn(hObject, eventdata, handles)
	varargout{1} = handles.output;


% --------------------------------------------------------------------
function FileMenu_Callback(hObject, eventdata, handles)


% --------------------------------------------------------------------
function OpenMenuItem_Callback(hObject, eventdata, handles)
	lpcexpofn 'loadsound';

% --------------------------------------------------------------------
function PrintMenuItem_Callback(hObject, eventdata, handles)
	lpcexpofn 'print';

% --------------------------------------------------------------------
function CloseMenuItem_Callback(hObject, eventdata, handles)
	lpcexpofn 'close';

% --- Executes on button press in play2.
function play2_Callback(hObject, eventdata, handles)
	lpcexpofn 'playsound2';

% --- Executes on button press in print.
function print_Callback(hObject, eventdata, handles)
	lpcexpofn 'print';

% --- Executes during object creation, after setting all properties.
function synwindowsize_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synwindowsize (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in synwindowsize.
function synwindowsize_Callback(hObject, eventdata, handles)
% hObject    handle to synwindowsize (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 synwindowsize contents as cell array
%        contents{get(hObject,'Value')} returns selected item from synwindowsize


% --- Executes during object creation, after setting all properties.
function synwindowshape_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synwindowshape (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in synwindowshape.
function synwindowshape_Callback(hObject, eventdata, handles)
% hObject    handle to synwindowshape (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 synwindowshape contents as cell array
%        contents{get(hObject,'Value')} returns selected item from synwindowshape


% --- Executes on button press in play1.
function play1_Callback(hObject, eventdata, handles)
	lpcexpofn 'playsound1';


% --- Executes on button press in synthesize.
function synthesize_Callback(hObject, eventdata, handles)
	lpcexpofn 'synthesize';

% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function sendorigfourier_Callback(hObject, eventdata, handles)
% hObject    handle to sendorigfourier (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    lpcexpofn 'orig_fourier';
    
% --------------------------------------------------------------------
function sendorigsonogram_Callback(hObject, eventdata, handles)
% hObject    handle to sendorigsonogram (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    lpcexpofn 'orig_sonogram';

% --------------------------------------------------------------------
function Untitled_5_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Untitled_6_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function sendsynthfourier_Callback(hObject, eventdata, handles)
% hObject    handle to sendsynthfourier (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    lpcexpofn 'synth_fourier';

% --------------------------------------------------------------------
function sendsynthsonogram_Callback(hObject, eventdata, handles)
% hObject    handle to sendsynthsonogram (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
    lpcexpofn 'synth_sonogram';

% --- Executes during object creation, after setting all properties.
function phasemenu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to phasemenu (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in phasemenu.
function phasemenu_Callback(hObject, eventdata, handles)


% --- Executes during object creation, after setting all properties.
function analwindowsize_CreateFcn(hObject, eventdata, handles)
% hObject    handle to analwindowsize (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in analwindowsize.
function analwindowsize_Callback(hObject, eventdata, handles)
% hObject    handle to analwindowsize (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 analwindowsize contents as cell array
%        contents{get(hObject,'Value')} returns selected item from analwindowsize
	lpcexpofn 'colacheck';


% --- Executes during object creation, after setting all properties.
function analwindowshape_CreateFcn(hObject, eventdata, handles)
% hObject    handle to analwindowshape (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in analwindowshape.
function analwindowshape_Callback(hObject, eventdata, handles)
% hObject    handle to analwindowshape (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 analwindowshape contents as cell array
%        contents{get(hObject,'Value')} returns selected item from analwindowshape


% --- Executes on button press in analyze.
function analyze_Callback(hObject, eventdata, handles)
	lpcexpofn 'analyze';


% --- Executes during object creation, after setting all properties.
function excite_menu_CreateFcn(hObject, eventdata, handles)
% hObject    handle to excite_menu (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in excite_menu.
function excite_menu_Callback(hObject, eventdata, handles)
% hObject    handle to excite_menu (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 excite_menu contents as cell array
%        contents{get(hObject,'Value')} returns selected item from excite_menu
	contents = get(hObject,'String');
	switch lower(contents{get(hObject,'Value')})
		case {'residual','noise','other'}
			set(handles.excite_text,'Visible','off');
            set(handles.excite_freq,'Visible','off');
		case 'pulses'
			set(handles.excite_text,'Visible','on');
            set(handles.excite_freq,'Visible','on');
	end


% --------------------------------------------------------------------
function saveresynth_Callback(hObject, eventdata, handles)
% hObject    handle to saveresynth (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	lpcexpofn 'saveresynth';


% --- Executes during object creation, after setting all properties.
function synthwindowsize_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synthwindowsize (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 synthwindowsize_Callback(hObject, eventdata, handles)
% hObject    handle to synthwindowsize (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 synthwindowsize as text
%        str2double(get(hObject,'String')) returns contents of synthwindowsize as a double
	lpcexpofn 'colacheck';


% --- Executes during object creation, after setting all properties.
function synthwindowskip_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synthwindowskip (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 synthwindowskip_Callback(hObject, eventdata, handles)
% hObject    handle to synthwindowskip (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 synthwindowskip as text
%        str2double(get(hObject,'String')) returns contents of synthwindowskip as a double

function cola_CreateFcn(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
function analcola_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synthcola (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 synthcola_CreateFcn(hObject, eventdata, handles)
% hObject    handle to synthcola (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 button press in synthcola.
function synthcola_Callback(hObject, eventdata, handles)
% hObject    handle to synthcola (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 synthcola
	lpcexpofn 'colacheck';


% --- Executes during object creation, after setting all properties.
function analwindowskip_CreateFcn(hObject, eventdata, handles)
% hObject    handle to analwindowskip (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 analwindowskip_Callback(hObject, eventdata, handles)
% hObject    handle to analwindowskip (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 analwindowskip as text
%        str2double(get(hObject,'String')) returns contents of analwindowskip as a double


% --- Executes on button press in analcola.
function analcola_Callback(hObject, eventdata, handles)
% hObject    handle to analcola (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 analcola
	lpcexpofn 'colacheck';


% --------------------------------------------------------------------
function help_Callback(hObject, eventdata, handles)
% hObject    handle to help (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
     lpcexpofn 'help';


% --- Executes on button press in normalize.
function normalize_Callback(hObject, eventdata, handles)
% hObject    handle to normalize (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	lpcexpofn 'normalize';


% --- Executes on button press in play_resplot.
function play_residual_Callback(hObject, eventdata, handles)
% hObject    handle to play_resplot (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	lpcexpofn 'play_residual';


% --- Executes on button press in norm_resplot.
function norm_residual_Callback(hObject, eventdata, handles)
% hObject    handle to norm_resplot (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	lpcexpofn 'norm_residual';


% --- Executes during object creation, after setting all properties.
function order_CreateFcn(hObject, eventdata, handles)
% hObject    handle to order (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 order_Callback(hObject, eventdata, handles)
% hObject    handle to order (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 order as text
%        str2double(get(hObject,'String')) returns contents of order as a double


% --- Executes during object creation, after setting all properties.
function excite_freq_CreateFcn(hObject, eventdata, handles)
% hObject    handle to excite_freq (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 excite_freq_Callback(hObject, eventdata, handles)
% hObject    handle to excite_freq (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 excite_freq as text
%        str2double(get(hObject,'String')) returns contents of excite_freq as a double