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

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

% Last Modified by GUIDE v2.5 18-Nov-2004 10:10:30

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

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

    if (nargin > 3)
        datastruct = varargin{1};
        reverbexpofn('readinput',datastruct);
    end


% --- Outputs from this function are returned to the command line.
function varargout = reverbexpo_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 play.
function play_Callback(hObject, eventdata, handles)
% hObject    handle to play (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	reverbexpofn 'playsound';


% --- Executes on button press in filter1.
function filter1_Callback(hObject, eventdata, handles)
% hObject    handle to filter1 (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 filter1
	reverbexpofn 'update';


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


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


% --- Executes on button press in filter2.
function filter2_Callback(hObject, eventdata, handles)
% hObject    handle to filter2 (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 filter2
	reverbexpofn 'update';


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


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


% --- Executes on button press in filter3.
function filter3_Callback(hObject, eventdata, handles)
% hObject    handle to filter3 (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 filter3
	reverbexpofn 'update';


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


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


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


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


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


% --- 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 during object creation, after setting all properties.
function filter1_type_CreateFcn(hObject, eventdata, handles)
% hObject    handle to filter1_type (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 filter1_type.
function filter1_type_Callback(hObject, eventdata, handles)
% hObject    handle to filter1_type (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 filter1_type contents as cell array
%        contents{get(hObject,'Value')} returns selected item from filter1_type
	if get(hObject,'Value')
		reverbexpofn 'update';
	end


% --- Executes during object creation, after setting all properties.
function filter2_type_CreateFcn(hObject, eventdata, handles)
% hObject    handle to filter2_type (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 filter2_type.
function filter2_type_Callback(hObject, eventdata, handles)
% hObject    handle to filter2_type (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 filter2_type contents as cell array
%        contents{get(hObject,'Value')} returns selected item from filter2_type
	if get(hObject,'Value')
		reverbexpofn 'update';
	end


% --- Executes during object creation, after setting all properties.
function filter3_type_CreateFcn(hObject, eventdata, handles)
% hObject    handle to filter3_type (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 filter3_type.
function filter3_type_Callback(hObject, eventdata, handles)
% hObject    handle to filter3_type (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 filter3_type contents as cell array
%        contents{get(hObject,'Value')} returns selected item from filter3_type
	if get(hObject,'Value')
		reverbexpofn 'update';
	end


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


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


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

% --------------------------------------------------------------------
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 fourierexpo_Callback(hObject, eventdata, handles)
% hObject    handle to fourierexpo (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	reverbexpofn 'fourier';


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

% --------------------------------------------------------------------
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)
	reverbexpofn 'help';


% --- Executes during object creation, after setting all properties.
function timeslider_CreateFcn(hObject, eventdata, handles)
% hObject    handle to timeslider (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, change
%       'usewhitebg' to 0 to use default.  See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on slider movement.
function timeslider_Callback(hObject, eventdata, handles)
% hObject    handle to timeslider (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
	reverbexpofn 'timeslider';


% --------------------------------------------------------------------
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 plainecho_Callback(hObject, eventdata, handles)
% hObject    handle to plainecho (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	reverbexpofn('preset','plainecho');


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


% --------------------------------------------------------------------
function reverb_Callback(hObject, eventdata, handles)
% hObject    handle to reverb1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
	reverbexpofn('preset','reverb');


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