matlab代码_语音信号分析和去噪处理

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

ISX文理学院数理信息学院数字信号处理课程设计报告书题目语音信号分析与去噪处理姓名学号专业班级电信11级信号处理指导教师于刘时间年月日I课程设计任务书班级电信112姓名题目语音信号分析与去噪处理技术参数、设计要求、检测数据等(1)语音信号的采集:利用Windows下的录音机,录制一段自己的话音,时间在10秒内,然后在MATLAB软件下,利用函数wavread对语音信号进行采样,记录采样频率和采样点数。(2)语音信号的频谱分析:首先画出语音信号的时域波形,然后对语音信号进行频谱分析。(3)分别设计低通、高通和带通滤波器对语音信号进行滤波后对语音信号进行回放(函数sound可以对声音进行回放),分析比较滤波结果。(4)对语音信号进行加入高斯白噪声(用randn函数产生随机序列)设计滤波器对语音信号进行滤波后对语音信号进行回放,分析比较滤波结果。(上述滤波器分别采用IIR和FIR滤波结构实现)设计进度安排或工作计划2014.7.1~2014.7.2:熟悉课题,查询相关资料,完成方案选择。2014.7.3~2014.7.6:设计模块划分、实现及各模块调试、验证。2014.7.7~2014.7.8:设计整体实现、调试及验证,并开始撰写报告。2014.7.9~2014.7.10:设计完成,课程设计报告撰写并定稿,上交。其它认真阅读数字信号处理课程设计报告撰写规范;课题小组经协商好要指定组长并明确分工,形成良好团队工作氛围;基于课题基本要求,各小组课再细化、增加要求;课题小组每成员均需各自撰写一份课程设计报告。II附录源码functionvarargout=PF(varargin)%PFMATLABcodeforPF.fig%PF,byitself,createsanewPForraisestheexisting%singleton*.%%H=PFreturnsthehandletoanewPForthehandleto%theexistingsingleton*.%%PF('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinPF.Mwiththegiveninputarguments.%%PF('Property','Value',...)createsanewPForraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforePF_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.AllinputsarepassedtoPF_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%%Seealso:GUIDE,GUIDATA,GUIHANDLES%EdittheabovetexttomodifytheresponsetohelpPF%LastModifiedbyGUIDEv2.506-Jul-201411:15:51%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@PF_OpeningFcn,...'gui_OutputFcn',@PF_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});IIIendifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%---ExecutesjustbeforePFismadevisible.functionPF_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%varargincommandlineargumentstoPF(seeVARARGIN)%ChoosedefaultcommandlineoutputforPFhandles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakesPFwaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=PF_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%---Executesonbuttonpressinpushbutton1.functionpushbutton1_Callback(hObject,eventdata,handles)IV%hObjecthandletopushbutton1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%************语音信号采集******************globalYLYHYKYGYY;globalFBB;[fn,pn,fi]=uigetfile('*.wav','selectawav-file');%调用选择文件对话框,返回fn代表名字,pn代表路径name=strcat(pn,fn);[y1,Fs,bits]=wavread(name);%采样值放在向量y中,fs表示采样频率(hz),bits表示采样位数T=length(y1)/Fs;set(handles.text4,'string',Fs);set(handles.text12,'string',T);set(handles.text15,'string',bits);YL=y1;YH=y1;YK=y1;YG=y1;YY=y1;BB=bits;F=Fs;Y=fft(y1,524288);plot(handles.axes1,0:1/Fs:(length(y1)-1)/Fs,y1);axes(handles.axes1);legend('原信号波形',1);stem(handles.axes2,0:2*pi/524288:2*pi-1/524288,abs(Y),'.');set(handles.axes2,'ylim',[01500],'xlim',[02*pi]);axes(handles.axes2);legend('原信号频谱',1);%************************************************%---Executesonbuttonpressinpushbutton2.functionpushbutton2_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton2(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%*****************声音播放****************************globalYYFBB;y1=YY;Fs=F;bits=BB;sound(YY,Fs,bits);%播放声音V%---Executesonbuttonpressinpushbutton3.functionpushbutton3_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton3(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%*******************高斯噪声**************************globalhzYYYG;y1=YG;h=0.05*randn(size(y1));z=plus(h,y1);Z=fft(z,524288);stem(handles.axes4,0:2*pi/524288:2*pi-1/524288,abs(Z),'.');set(handles.axes4,'ylim',[01500],'xlim',[02*pi]);axes(handles.axes4);legend('加入高斯噪声频谱',1);YY=z;%---Executesonbuttonpressinpushbutton4.functionpushbutton4_Callback(hObject,eventdata,handles)%hObjecthandletopushbutton4(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%***************滤除高斯噪声******************globalhzYY;%*****************自适应算法***********************w=[0,1];%初始2阶加权系数u=0.00026;%最佳参数fori=1:length(z);y(i+1)=h(i:i+1)*w';e(i+1)=z(i+1)-y(i+1);w=w+2*u*e(i+1)*h(i:i+1);end;Y=fft(e,524288);stem(handles.axes4,0:2*pi/52428

1 / 13
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功