function varargout = basic(varargin)
% BASIC M-file for basic.fig
% BASIC, by itself, creates a new BASIC or raises the existing
% singleton*.
%
% H = BASIC returns the handle to a new BASIC or the handle to
% the existing singleton*.
%
% BASIC('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BASIC.M with the given input arguments.
%
% BASIC('Property','Value',...) creates a new BASIC or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before basic_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to basic_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help basic
% Last Modified by GUIDE v2.5 02-Apr-2006 23:04:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @basic_OpeningFcn, ...
'gui_OutputFcn', @basic_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 basic is made visible.
function basic_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 basic (see VARARGIN)
% Choose default command line output for basic
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes basic wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = basic_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 checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject handle to checkbox1 (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 checkbox1
if (get(hObject,'Value') == get(hObject,'Max'))
Nsample=length(handles.z);
i=handles.z([1:Nsample]);
axes(handles.axes1)
plot(i,'y');
axis([1 Nsample min(handles.z) max(handles.z)]);%signal fit the axes
legend('Waveform');
xlabel('Samples');
ylabel('Amplitude');
set(gca,'color','k'); set(gca,'Xcolor','r'); set(gca,'Ycolor','r');
else
axes(handles.axes1)
plot(handles.t,handles.z,'y');
axis([0 handles.tt min(handles.z) max(handles.z)]);
legend('Waveform');
xlabel('Time (msec)');
ylabel('Amplitude');
set(gca,'color','k'); set(gca,'Xcolor','r'); set(gca,'Ycolor','r');
end
% --------------------------------------------------------------------
function open_menu_Callback(hObject, eventdata, handles)
% hObject handle to open_menu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
frmlength1 = str2double(get(handles.frmlength1,'string'));
index1 = str2double(get(handles.index1,'string'));
shift1 = str2double(get(handles.shift1,'string'));
fftsiz1 = str2double(get(handles.fftsiz1,'string'));
[filename, path, filterindex] = uigetfile( ...
{ '*.wav','Open files (*.wav)'; ...
'*.*', 'All Files (*.*)'}, ...
'Pick a file', ...
'MultiSelect', 'on')
if isequal(filename,0)
msg=('User selected Cancel') % print warning message
warndlg(msg)
else
disp(['User selected', fullfile(path, filename)])
end
if filename ~=0,
[z,Fs,bits]=wavread([path,filename]);
Nsample=length(z);% total sample
tt= 1000*Nsample/Fs; % total time
t=1000*(0:length(z)-1)/Fs; %corresponding time
frmlength=frmlength1;
shift =shift1;
start_point =1 + shift*(index1-1);
end_point =frmlength + shift*(index1-1);
frmsig=z(start_point:end_point);% frame signal
frmsigz = [frmsig;zeros([1024-frmlength,1])];% adding 0s to frame signal 1024bit
frmsigwFFT=fft(frmsigz,fftsiz1); % do Fast Fourier Transform
frmsigwFFT=abs(frmsigwFFT); % get positive value
spect= frmsigwFFT(1:frmlength/2+1); % calculate Spectrum
Frequency=Fs*(0:frmlength/2)/frmlength;% calculate corresponding frequency
dBMag = 20*log10(abs(spect)); %define magnitude
handles.z=z; % handels variables
handles.Fs=Fs;
handles.t=t;
handles.dBMag=dBMag;
handles.Frequency=Frequency;
handles.frmsigz=frmsigz;
handles.Nsample=Nsample;
handles.tt=tt;
set(handles.totalsampletext,'String',Nsample); % display parameters on GUI
set(handles.time,'String',tt);
set(handles.FS,'String',Fs);
set(handles.fname,'String',filename);
set(handles.status,'String',path);
end
guidata(hObject,handles);
% --------------------------------------------------------------------
function file_menu_Callback(hObject, eventdata, handles)
% hObject handle to file_menu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function save_menu_Callback(hObject, eventdata, handles)
% hObject handle to save_menu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%========================save recored signal==========
[path,filename]=uiputfile('*.wav','Save file');
Fs=8000;
N=16;
wavwrite(handles.y,Fs,N,[filename, path])
guidata(hObject,handles);
;
% --------------------------------------------------------------------
function printv_menu_Callback(hObject, eventdata, handles)
% hObject handle to printv_menu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
printpreview
% --------------------------------------------------------------------
function print_menu_Callback(hObject, eventdata, handles)
% hObject handle to print_menu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
print
% --------------------------------------------------------------------
function exit_menu_Callback(hObject, eventdata, handles)
% hObject handle to exit_menu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close all
% --------------------------------------------------------------------
function copy_menu_Callback(hObject, eventdata, handles)
% hObject handle to copy_menu (see GCBO)
% eventdata reserved - to be defined in a fu
没有合适的资源?快使用搜索试试~ 我知道了~
speechprocessing.rar_GUI_GUI matlab_Voice recording GUI_gui 语音处理
共7个文件
jpg:2个
m:2个
fig:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 171 浏览量
2022-07-13
18:11:12
上传
评论
收藏 76KB RAR 举报
温馨提示
语音处理软件, GUI 界面,本人原创,频域,时域,可以看波形,WINDOW FUNCTION, 录音,
资源推荐
资源详情
资源评论
收起资源包目录
speechprocessing.rar (7个子文件)
logo1.jpg 20KB
main.m 4KB
basic.fig 10KB
logo.jpg 52KB
www.pudn.com.txt 218B
main.fig 4KB
basic.m 25KB
共 7 条
- 1
资源评论
邓凌佳
- 粉丝: 65
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功