matlab项目总结报告.doc_第1页
matlab项目总结报告.doc_第2页
matlab项目总结报告.doc_第3页
matlab项目总结报告.doc_第4页
matlab项目总结报告.doc_第5页
已阅读5页,还剩41页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

中国民航大学电子信息工程学院MATLAB声音和图像信号分析处理课程设计报告题 目:matlab信号采集、分析、处理实验专业班级: 101045A 姓名:李雄洲 李文君 李阳 雷明超指导教师: 韩萍 何炜琨 二一二 年六月十五日 44目 录一、设计目的二、设计要求三、设计原理及方案四、硬件电路或软件流程五、调试分析六、设计总结七、参考文献八、附录(程序代码及元件清单)一、 设计目的课题目的在于通过matlab仿真实验,熟悉matlab的操作环境,深刻体会信号处理的研究方法,使所学知识融会贯通,最大程度锻炼工程项目能力。二、设计要求声音部分:本次课程设计的目的是利用MATLAB对语音信号进行数字信号处理和分析,要求学生采集语音信号后,在MATLAB软件平台进行频谱分析;并对所采集的语音信号加入干扰噪声,对加入噪声的信号进行频谱分析,设计合适的滤波器滤除噪声,恢复原信号。要求利用MATLAB来读入(采集)语音信号,将它赋值给某一向量。再将该向量看作一个普通的信号,对其进行FFT变换实现频谱分析,再依据实际情况对它进行滤波。然后我们还可以通过sound命令来对语音信号进行回放,以便在听觉上来感受声音的变化。图形部分:搭建一个简单界面,实现信号(图像)的加载并显示,对采集信号进行加噪,并对加噪前后信号进行谱分析,将信号分析部分加载到所做界面中将滤波器设计部分加载到所做界面中,信号特技效果实现。三、设计原理与方案1、设计原理MATLAB是矩阵实验室(Matrix Laboratory)的简称,是美国MathWorks公司出品的商业数学软件,用于算法开发、数据可视化、数据分析以及数值计算的高级技术计算语言和交互式环境。通过MATLAB里几个命令函数的调用,很轻易的在实际语音与数字信号的理论之间搭了一座桥。课题的特色在于它将语音信号看作一个向量,于是就把语音数字化了。那么,就可以完全利用数字信号处理的知识来解决语音及加噪处理问题。我们可以像给一般信号做频谱分析一样,来对语音信号做频谱分析,也可以较容易的用数字滤波器来对语音进行滤波处理。FIR滤波器结构上主要是非递归结构,没有输出到输入的反馈,系统函数H (z)在处收敛,极点全部在z = 0处(因果系统),因而只能用较高的阶数达到高的选择性。FIR数字滤波器的幅频特性精度较之于IIR数字滤波器低,但是线性相位,就是不同频率分量的信号经过fir滤波器后他们的时间差不变,这是很好的性质。FIR数字滤波器是有限的单位响应也有利于对数字信号的处理,便于编程,用于计算的时延也小,这对实时的信号处理很重要。 FIR滤波器因具有系统稳定,易实现相位控制,允许设计多通带(或多阻带)滤波器等优点收到人们的青睐。IIR滤波器采用递归型结构,即结构上带有反馈环路。IIR滤波器运算结构通常由延时、乘以系数和相加等基本运算组成,可以组合成直接型、正准型、级联型、并联型四种结构形式,都具有反馈回路。同时,IIR数字滤波器在设计上可以借助成熟的模拟滤波器的成果,如巴特沃斯、契比雪夫和椭圆滤波器等,有现成的设计数据或图表可查,在设计一个IIR数字滤波器时,我们根据指标先写出模拟滤波器的公式,然后通过一定的变换,将模拟滤波器的公式转换成数字滤波器的公式。在matlab中,一幅图片可以定义为一个二维函数f(x, y),其中x和y表示空间坐标,而f对于任何一对(x, y)坐标的函数值称为该点处图像的亮度或灰度。当x, y和f的值都是有限的、离散的数值时,称该图像为数字图像。 图像编码压缩技术可减少描述图像的数据量(即比特数),以便节省图像传输、处理时间和减少所占用的存储器容量。压缩可以在不失真的前提下获得,也可以在允许的失真条件下进行。编码是压缩技术中最重要的方法,它在图像处理技术中是发展最早且比较成熟的技术。 图像增强和复原的目的是为了提高图像的质量,如去除噪声,提高图像的清晰度等。图像增强不考虑图像降质的原因,突出图像中所感兴趣的部分。如强化图像高频分量,可使图像中物体轮廓清晰,细节明显;如强化低频分量可减少图像中噪声影响。图像复原要求对图像降质的原因有一定的了解,一般讲应根据降质过程建立“降质模型”,再采用某种滤波方法,恢复或重建原来的图像。 2、设计方案MATLAB软件熟悉与运用。信号处理原理分析与处理方法讨论。使用matlab中的 GUI 进行搭建仿真测试与调试。四、软件流程五、调试分析项目最开始的问题的是给GUI加一张背景图片,起初的想法是在界面上放一个坐标,结果很不理想,后来发现本来GUI的界面就是一个坐标,我们只要设置好就行,因而就有了很经典的那段程序:ha=axes(units,normalized,position,0 0 1 1);uistack(ha,down)II=imread(cauc.bmp);image(II)colormap grayset(ha,handlevisibility,off ,visible,off );这里面有个很有趣的东西,我们可以设置图片为最底层,只要把down改成button就好程序在画图时,在GUI上放了一些坐标轴,但是设计得比较难看,因而使用程序为其设置位置与大小:h=subplot(1,1,1);set(h,position,0.1 0.1 0.8 0.7);起到了很好的效果。做回声那块儿东西的时候,一直无法取到很好的效果,回声效果一直不是很理想,最后试了好多次:global x;N=length(x);x1=x(1:N);x2=x(1:N);x1=x1,zeros(1,3000);x2=zeros(1,1500),0.4*x2,zeros(1,1500);y=x1+x2;终于发现,分成1500和1500等长的两段之后,发现效果还是不错的,不知道是不是最好,但是已经很不错了。六、设计总结通过此次项目,我们不仅把知识融会贯通,而且丰富了大脑,同时在查找资料的过程中也了解了许多课外知识,开拓了视野,认识了自己将来的发展方向,使自己在专业知识方面和动手能力方面有了质的飞跃。信号处理项目是对学校所学知识的全面总结和综合应用,又为今后走向社会的实际操作应用铸就了一个良好开端,对我们所学知识理论的检验与总结,能够培养和提高设计者独立分析和解决问题的能力;其次,项目指导是老师检验其教学效果,改进教学方法,提高教学质量的绝好机会。在没有做信号处理项目以前觉得信号处理项目只是对这一年来所学知识的大概总结,但是真的面对信号处理项目发现自己的想法基本是错误的。信号处理项目不仅是对前面所学知识的一种检验,而且也是对自己能力的一种提高。通过这次信号处理项目使我们明白了自己原来知识太理论化了,面对单独的课题的是感觉很茫然。通过这次信号处理项目,我们终于明白学习是一个长期积累的过程,在以后的工作、生活中都应该不断的学习,努力提高自己知识和综合素质。总之,不管学会的还是学不会的的确觉得困难比较多,真是万事开头难,不知道如何入手。最后终于做完了有种如释重负的感觉。此外,还得出一个结论:知识必须通过应用才能实现其价值!有些东西以为学会了,但真正到用的时候才发现是两回事,所以我认为只有到真正会用的时候才是真的学会了。在此要感谢我们指导老师悉心的指导,感谢老师们给我的帮助。在项目过程中,我们通过查阅大量有关资料,与同学交流经验和自学,并向老师请教等方式,使自己学到了不少知识,也经历了不少艰辛,但收获同样巨大。在整个项目中我懂得了许多东西,也培养了我们工作的能力,树立了对自己工作能力的信心。而且大大提高了动手的能力,使我们充分体会到了在创造过程中探索的艰难和成功时的喜悦。虽然这个项目做的也不太好,但是在项目过程中所学到的东西是这次项目的最大收获和财富,使我们终身受益。七、参考文献1J.S.park。matlab gui tutorial for beginners。 University of Incheon。 2 易克初,等.语音信号处理M.北京:国防工业出版社,2006,6.3胡航.语音信号处理M.哈尔滨:哈尔滨工业大学出版社,2000,5.4韩纪庆,张磊,郑铁然.语音信号处理M.北京:清华大学出版社,20045彭军。一个实例搞定matlab界面编程。八、附录(程序代码及元件清单)function varargout = open_the_road_5(varargin)% OPEN_THE_ROAD_5 M-file for open_the_road_5.fig% OPEN_THE_ROAD_5, by itself, creates a new OPEN_THE_ROAD_5 or raises the existing% singleton*.% H = OPEN_THE_ROAD_5 returns the handle to a new OPEN_THE_ROAD_5 or the handle to% the existing singleton*.% OPEN_THE_ROAD_5(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in OPEN_THE_ROAD_5.M with the given input arguments.% OPEN_THE_ROAD_5(Property,Value,.) creates a new OPEN_THE_ROAD_5 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before open_the_road_5_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to open_the_road_5_OpeningFcn via varargin.% *See GUI Options on GUIDEs 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 open_the_road_5 % Last Modified by GUIDE v2.5 28-May-2012 21:53:24 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, open_the_road_5_OpeningFcn, . gui_OutputFcn, open_the_road_5_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT % - Executes just before open_the_road_5 is made visible.function open_the_road_5_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 open_the_road_5 (see VARARGIN) % Choose default command line output for open_the_road_5handles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes open_the_road_5 wait for user response (see UIRESUME)% uiwait(handles.figure1); % - Outputs from this function are returned to the command line.function varargout = open_the_road_5_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 structurevarargout1 = handles.output; % - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)close(gcf)run(open_the_road_4)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % - Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)close(gcf)run(open_the_road_6)% hObject handle to pushbutton2 (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 figure1_CreateFcn(hObject, eventdata, handles)ha=axes(units,normalized,position,0 0 1 1);uistack(ha,down)II=imread(cauc.bmp);image(II)colormap grayset(ha,handlevisibility,off ,visible,off );% hObject handle to figure1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns calledfunction varargout = open_the_road_4(varargin)% OPEN_THE_ROAD_4 M-file for open_the_road_4.fig% OPEN_THE_ROAD_4, by itself, creates a new OPEN_THE_ROAD_4 or raises the existing% singleton*.% H = OPEN_THE_ROAD_4 returns the handle to a new OPEN_THE_ROAD_4 or the handle to% the existing singleton*.% OPEN_THE_ROAD_4(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in OPEN_THE_ROAD_4.M with the given input arguments.% OPEN_THE_ROAD_4(Property,Value,.) creates a new OPEN_THE_ROAD_4 or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before open_the_road_4_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to open_the_road_4_OpeningFcn via varargin.% *See GUI Options on GUIDEs 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 open_the_road_4 % Last Modified by GUIDE v2.5 30-May-2012 08:35:36 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, open_the_road_4_OpeningFcn, . gui_OutputFcn, open_the_road_4_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT % - Executes just before open_the_road_4 is made visible.function open_the_road_4_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 open_the_road_3 (see VARARGIN) % Choose default command line output for open_the_road_3handles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes open_the_road_3 wait for user response (see UIRESUME)% uiwait(handles.figure1); % - Outputs from this function are returned to the command line.function varargout = open_the_road_4_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 structurevarargout1 = handles.output; % - Executes during object creation, after setting all properties.function figure1_CreateFcn(hObject, eventdata, handles)% hObject handle to figure1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % -function Untitled_1_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -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)filename,pathname= . uigetfile(*.wav);global s;s=pathname filename;s,fs,nbits=wavread(s);sound(s,fs,nbits); % -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)global s;h=subplot(1,1,1);set(h,position,0.1 0.1 0.8 0.7);plot(s);title() % -function Untitled_4_Callback(hObject, eventdata, handles)% hObject handle to Untitled_4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global s;y=fft(s);n=0:length(y)-1;h=subplot(1,1,1);set(h,position,0.1 0.1 0.8 0.7); plot(n,abs(y);title() % -function Untitled_5_Callback(hObject, eventdata, handles)% hObject handle to Untitled_5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_6_Callback(hObject, eventdata, handles)% hObject handle to Untitled_6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)filename,pathname= . uigetfile(*.wav);global x;x=pathname filename;x,fs,nbits=wavread(x);t=0:1/22050:(length(x)-1)/22050;d=(0.5*cos(2*pi*8000*t);x2=x+d;sound(x2,fs,nbits); % -function Untitled_7_Callback(hObject, eventdata, handles)% hObject handle to Untitled_7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global x;t=0:1/22050:(length(x)-1)/22050;d=(0.5*cos(2*pi*8000*t);x2=x+d;subplot(2,1,2);plot(x2);title()subplot(2,1,1); plot(x);title() % -function Untitled_8_Callback(hObject, eventdata, handles)% hObject handle to Untitled_8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global x;t=0:1/22050:(length(x)-1)/22050;d=(0.5*cos(2*pi*8000*t);x2=x+d;y2=fft(x2);y=fft(x);n=0:length(y2)-1;subplot(2,1,2);plot(n,abs(y2);title()subplot(2,1,1);plot(n,abs(y);title() % -function Untitled_9_Callback(hObject, eventdata, handles)% hObject handle to Untitled_9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_10_Callback(hObject, eventdata, handles)% hObject handle to Untitled_10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)wp=0.25*pi;ws=0.3*pi;Rp=1;Rs=15;Fs=22050;Ts=1/Fs;wp1=2/Ts*tan(wp/2);ws1=2/Ts*tan(ws/2);N,Wn=buttord(wp1,ws1,Rp,Rs,s);Z,P,K=buttap(N);Bap,Aap=zp2tf(Z,P,K);b,a=lp2lp(Bap,Aap,Wn);bz,az=bilinear(b,a,Fs);H,W=freqz(bz,az);h=subplot(1,1,1);set(h,position,0.1 0.1 0.8 0.7); plot(W*Fs/(2*pi),abs(H);title() % -function Untitled_11_Callback(hObject, eventdata, handles)% hObject handle to Untitled_11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)filename,pathname= . uigetfile(*.wav);global y;y=pathname filename;y,fs,nbits=wavread(y);t=0:1/22050:(length(y)-1)/22050;d=(0.5*cos(2*pi*8000*t);x3=y+d;wp=0.25*pi;ws=0.3*pi;Rp=1;Rs=15;Fs=22050;Ts=1/Fs;wp1=2/Ts*tan(wp/2);ws1=2/Ts*tan(ws/2);N,Wn=buttord(wp1,ws1,Rp,Rs,s);Z,P,K=buttap(N);Bap,Aap=zp2tf(Z,P,K);b,a=lp2lp(Bap,Aap,Wn);bz,az=bilinear(b,a,Fs);f1=filter(bz,az,x3);sound(f1,fs,nbits); % -function Untitled_12_Callback(hObject, eventdata, handles)% hObject handle to Untitled_12 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global y;t=0:1/22050:(length(y)-1)/22050;d=(0.5*cos(2*pi*8000*t);x3=y+d;wp=0.25*pi;ws=0.3*pi;Rp=1;Rs=15;Fs=22050;Ts=1/Fs;wp1=2/Ts*tan(wp/2);ws1=2/Ts*tan(ws/2);N,Wn=buttord(wp1,ws1,Rp,Rs,s);Z,P,K=buttap(N);Bap,Aap=zp2tf(Z,P,K);b,a=lp2lp(Bap,Aap,Wn);bz,az=bilinear(b,a,Fs);f1=filter(bz,az,x3);subplot(3,1,3);plot(f1);title()subplot(3,1,1);plot(y);title()subplot(3,1,2);plot(x3);title() % -function Untitled_13_Callback(hObject, eventdata, handles)% hObject handle to Untitled_13 (see GCBO)% eventdata reserved - to be defined in a future version of MATLA

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论