大连理工大学数字信号处理实验实验四含噪语音信号分析_精品文档Word文件下载.doc
- 文档编号:13881480
- 上传时间:2022-10-14
- 格式:DOC
- 页数:9
- 大小:401KB
大连理工大学数字信号处理实验实验四含噪语音信号分析_精品文档Word文件下载.doc
《大连理工大学数字信号处理实验实验四含噪语音信号分析_精品文档Word文件下载.doc》由会员分享,可在线阅读,更多相关《大连理工大学数字信号处理实验实验四含噪语音信号分析_精品文档Word文件下载.doc(9页珍藏版)》请在冰豆网上搜索。
实验四、含噪语音信号分析
一、实验题目和代码
1.实验界面设计
2.实验源程序:
functionvarargout=ly1(varargin)
%LY1MATLABcodeforly1.fig
%LY1,byitself,createsanewLY1orraisestheexisting
%singleton*.
%
%H=LY1returnsthehandletoanewLY1orthehandleto
%theexistingsingleton*.
%LY1('
CALLBACK'
hObject,eventData,handles,...)callsthelocal
%functionnamedCALLBACKinLY1.Mwiththegiveninputarguments.
Property'
'
Value'
...)createsanewLY1orraisesthe
%existingsingleton*.Startingfromtheleft,propertyvaluepairsare
%appliedtotheGUIbeforely1_OpeningFcngetscalled.An
%unrecognizedpropertynameorinvalidvaluemakespropertyapplication
%stop.Allinputsarepassedtoly1_OpeningFcnviavarargin.
%*SeeGUIOptionsonGUIDE'
sToolsmenu.Choose"
GUIallowsonlyone
%instancetorun(singleton)"
.
%Seealso:
GUIDE,GUIDATA,GUIHANDLES
%Edittheabovetexttomodifytheresponsetohelply1
%LastModifiedbyGUIDEv2.504-Jun-201515:
33:
58
%Begininitializationcode-DONOTEDIT
gui_Singleton=1;
gui_State=struct('
gui_Name'
mfilename,...
'
gui_Singleton'
gui_Singleton,...
gui_OpeningFcn'
@ly1_OpeningFcn,...
gui_OutputFcn'
@ly1_OutputFcn,...
gui_LayoutFcn'
[],...
gui_Callback'
[]);
ifnargin&
&
ischar(varargin{1})
gui_State.gui_Callback=str2func(varargin{1});
end
ifnargout
[varargout{1:
nargout}]=gui_mainfcn(gui_State,varargin{:
});
else
gui_mainfcn(gui_State,varargin{:
%Endinitializationcode-DONOTEDIT
%---Executesjustbeforely1ismadevisible.
functionly1_OpeningFcn(hObject,eventdata,handles,varargin)
%Thisfunctionhasnooutputargs,seeOutputFcn.
%hObjecthandletofigure
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
%varargincommandlineargumentstoly1(seeVARARGIN)
%Choosedefaultcommandlineoutputforly1
handles.output=hObject;
%初始化全局变量
fs=0;
%采样频率
f1=0;
%通带截止频率1
f2=0;
%通带截止频率2
f3=0;
%阻带起始频率1
f4=0;
%阻带起始频率2
data=0%采样数据存储
%Updatehandlesstructure
guidata(hObject,handles);
%UIWAITmakesly1waitforuserresponse(seeUIRESUME)
%uiwait(handles.figure1);
%---Outputsfromthisfunctionarereturnedtothecommandline.
functionvarargout=ly1_OutputFcn(hObject,eventdata,handles)
%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);
%Getdefaultcommandlineoutputfromhandlesstructure
varargout{1}=handles.output;
%---Executesonbuttonpressinpushbutton1.
functionpushbutton1_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton1(seeGCBO)
%读入一段音频文件
globalfs
globaldata
[filename,filepath]=uigetfile('
.wav'
选择音频文件'
);
if(filename==0)
return;
audeofile=strcat(filepath,filename);
[data,fs,handles.NBITS]=wavread(audeofile);
%语音信号的时域输出
t=0:
1/fs:
(length(data)-1)/fs;
subplot(handles.axes1)
plot(t,data);
%语音信号的频域输出
N=length(data);
y=fft(data,N);
f=(0:
1:
N-1)*fs/(N)-fs/2;
subplot(handles.axes2)
plot(f,fftshift(abs(y)));
%---Executesonbuttonpressinpushbutton2.
functionpushbutton2_Callback(hObject,eventdata,handles)
%hObjecthandletopushbutton2(seeGCBO)
globalfs
globaldata
subplot(handles.axes4)
t=0:
plot(t,data);
axis([00.5-11])
%语音信号频域输出
N=length(data);
Y=fft(data,N);
f=(0:
subplot(handles.axes5)
plot(f,fftshift(abs(Y)));
functionedit1_Callback(hObject,eventdata,handles)
%hObjecthandletoedit1(seeGCBO)
%Hints:
get(hObject,'
String'
)returnscontentsofedit1astext
%str2double(get(hObject,'
))returnscontentsofedit1asadouble
%取输入框数据
val=get(hObject,'
globalf1
f1=str2double(val);
%---Executesduringobjectcreation,aftersettingallproperties.
functionedit1_CreateFcn(hObject,e
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 大连理工大学 数字信号 处理 实验 四含噪 语音 信号 分析 精品 文档