当前位置:文档之家› 基于MATLAB GUI语音信号的采集分析系统

基于MATLAB GUI语音信号的采集分析系统

基于MATLABGUI的语音信号采集分析系统前一阵子用MA TLAB GUI做了一个语音信号采集与分析的界面。

功能包括录音、播放、时域、频域分析吧。

也导入本地文件进行分析。

效果如下:源码如下:function varargout = GUI_1(varargin)% GUI_1 MATLAB code for GUI_1.fig% GUI_1, by itself, creates a new GUI_1 or raises the existing% singleton*.%% H = GUI_1 returns the handle to a new GUI_1 or the handle to% the existing singleton*.%% GUI_1('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GUI_1.M with the given input arguments. %% GUI_1('Property','Value',...) creates a new GUI_1 or raises the % existing singleton*. Starting from the left, property value pairs are% applied to the GUI before GUI_1_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to GUI_1_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_1% Last Modified by GUIDE v2.5 25-May-2015 20:52:27% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @GUI_1_OpeningFcn, ...'gui_OutputFcn', @GUI_1_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); elsegui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before GUI_1 is made visible.function GUI_1_OpeningFcn(hObject, ~, 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_1 (see VARARGIN)% Choose default command line output for GUI_1set(handles.axes_t_m,'visible','off');set(handles.axes_fft_m,'visible','off');set(handles.axes_t_w,'visible','off');set(handles.axes_fft_w,'visible','off');global local_yn;local_yn=0;% a=imread('yanda.jpg');% axes(handles.axes_t_m)% image(a);handles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes GUI_1 wait for user response (see UIRESUME)% uiwait(handles.figure1);ha=axes('units','normalized','position',[0 0 1 1]);uistack(ha,'down')II=imread('暖色.JPG');image(II)colormap grayset(ha,'handlevisibility','off','visible','off');%--- Outputs from this function are returned to the command line.function varargout = GUI_1_OutputFcn(~, ~, 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 structurevarargout{1} = handles.output;% --- Executes on button press in pushbutton_luyin.function pushbutton_luyin_Callback(hObject, ~, handles)% hObject handle to pushbutton_luyin (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)% global recObj;% keyboard;% global sex_flag% switch sex_flag% case 0% set(handles.axes_t_m,'visible','on');% set(handles.axes_fft_m,'visible','on');% set(handles.axes_t_w,'visible','off');% set(handles.axes_fft_w,'visible','off');% case 1% set(handles.axes_t_m,'visible','off');% set(handles.axes_fft_m,'visible','off');% set(handles.axes_t_w,'visible','off');% set(handles.axes_fft_w,'visible','off');% case 2% set(handles.axes_t_m,'visible','off');% set(handles.axes_fft_m,'visible','off');% set(handles.axes_t_w,'visible','off');% set(handles.axes_fft_w,'visible','off');% endglobal local_yn;local_yn=0;fs_chose=handles.fs_chose;nBits=8;nChannels=1;%canshu={fs_chose,nBits,nChannels};if(str2double(get(handles.et_time,'String'))==0) %添加str2double 后正常set(handles.set_time,'String','时间参数输入错误!');msgbox('认真点好吗亲输入时间参数先。

相关主题