您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 北京理工大学-数字信号处理-实验报告-程序
数字信号处理实验报告一、实验目的1.深入掌握应用DFT分析信号的频谱的理论方法,针对该问题进行一次全面综合练习,完成一个完整的信号分析软件实现方法和流程,这种全面完整的综合练习可以帮助学生深入理解和消化基本理论,锻炼学生独立解决问题的能力,培养学生的创新意识,为今后的科研和工作打下良好的实践基础。2.综合利用数字信号处理的理论知识完成数字滤波器的设计与实现,完成一个完整的数字滤波器设计软件的实现方法和流程。这种全面完整的综合练习可以帮助学生深入理解和消化基本理论,锻炼学生独立解决问题的能力,培养学生的创新意识,为今后的科研和工作打下良好的实践基础。二、实验设备与环境计算机、MATLAB软件环境三、实验内容1.基于MatlabGUI的离散傅里叶变换分析2.基于MatlabGUI的数字滤波器分析设计四、实验结果1.基于MatlabGUI的离散傅里叶变换分析信号:t=1:100;x=2*sin(t/25*2*pi)+5*sin(t/5*2*pi);说明:输入信号从MatlabCommandWindows中生成,通过变量名导入本软件,并可输出DFT变换后的结果,默认名为DFT_输入变量名。2.基于MatlabGUI的数字滤波器分析设计IIR低通:(巴特沃兹)IIR高通:(切比雪夫I)IIR带通:(切比雪夫II)IIR带阻:(椭圆滤波器)FIR低通:(矩形窗)FIR高通:(汉宁窗)FIR带通:(布莱克曼窗)FIR带阻:(凯瑟窗)五、程序界面设计及程序源代码1.基于MatlabGUI的离散傅里叶变换分析界面设计:程序代码:functionvarargout=SignalDFTSoftware(varargin)%SIGNALDFTSOFTWAREMATLABcodeforSignalDFTSoftware.fig%SIGNALDFTSOFTWARE,byitself,createsanewSIGNALDFTSOFTWAREorraisestheexisting%singleton*.%%H=SIGNALDFTSOFTWAREreturnsthehandletoanewSIGNALDFTSOFTWAREorthehandleto%theexistingsingleton*.%%SIGNALDFTSOFTWARE('CALLBACK',hObject,eventData,handles,...)callsthelocal%functionnamedCALLBACKinSIGNALDFTSOFTWARE.Mwiththegiveninputarguments.%%SIGNALDFTSOFTWARE('Property','Value',...)createsanewSIGNALDFTSOFTWAREorraisesthe%existingsingleton*.Startingfromtheleft,propertyvaluepairsare%appliedtotheGUIbeforeSignalDFTSoftware_OpeningFcngetscalled.An%unrecognizedpropertynameorinvalidvaluemakespropertyapplication%stop.AllinputsarepassedtoSignalDFTSoftware_OpeningFcnviavarargin.%%*SeeGUIOptionsonGUIDE'sToolsmenu.ChooseGUIallowsonlyone%instancetorun(singleton).%%Seealso:GUIDE,GUIDATA,GUIHANDLES%EdittheabovetexttomodifytheresponsetohelpSignalDFTSoftware%LastModifiedbyGUIDEv2.526-Nov-201112:55:11%Begininitializationcode-DONOTEDITgui_Singleton=1;gui_State=struct('gui_Name',mfilename,...'gui_Singleton',gui_Singleton,...'gui_OpeningFcn',@SignalDFTSoftware_OpeningFcn,...'gui_OutputFcn',@SignalDFTSoftware_OutputFcn,...'gui_LayoutFcn',[],...'gui_Callback',[]);ifnargin&&ischar(varargin{1})gui_State.gui_Callback=str2func(varargin{1});endifnargout[varargout{1:nargout}]=gui_mainfcn(gui_State,varargin{:});elsegui_mainfcn(gui_State,varargin{:});end%Endinitializationcode-DONOTEDIT%---ExecutesjustbeforeSignalDFTSoftwareismadevisible.functionSignalDFTSoftware_OpeningFcn(hObject,eventdata,handles,varargin)%Thisfunctionhasnooutputargs,seeOutputFcn.%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%varargincommandlineargumentstoSignalDFTSoftware(seeVARARGIN)%ChoosedefaultcommandlineoutputforSignalDFTSoftwarehandles.output=hObject;%Updatehandlesstructureguidata(hObject,handles);%UIWAITmakesSignalDFTSoftwarewaitforuserresponse(seeUIRESUME)%uiwait(handles.figure1);%---Outputsfromthisfunctionarereturnedtothecommandline.functionvarargout=SignalDFTSoftware_OutputFcn(hObject,eventdata,handles)%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);%hObjecthandletofigure%eventdatareserved-tobedefinedinafutureversionofMATLAB%Getdefaultcommandlineoutputfromhandlesstructurevarargout{1}=handles.output;%---IfEnable=='on',executesonmousepressin5pixelborder.%---Otherwise,executesonmousepressin5pixelborderoroverrandom.functionrandom_ButtonDownFcn(hObject,eventdata,handles)%hObjecthandletorandom(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%---Executesonbuttonpressinrandom.functionrandom_Callback(hObject,eventdata,handles)%hObjecthandletorandom(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLABglobalx;globalx_flag;x=rand(1,50)*20-10;x_flag=1;if(x_flag)plot(handles.TD,0:(length(x)-1),x);end%---ExecutesonbuttonpressinDelete.functionDelete_Callback(hObject,eventdata,handles)%hObjecthandletoDelete(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLABglobalx;globalX;globalx_flag;globalX_flag;x=0;X=0;x_flag=0;X_flag=0;plot(handles.TD,0,0);plot(handles.FD,0,0);%---IfEnable=='on',executesonmousepressin5pixelborder.%---Otherwise,executesonmousepressin5pixelborderoroverDelete.functionDelete_ButtonDownFcn(hObject,eventdata,handles)%hObjecthandletoDelete(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%---IfEnable=='on',executesonmousepressin5pixelborder.%---Otherwise,executesonmousepressin5pixelborderoroverAnalyse.functionAnalyse_ButtonDownFcn(hObject,eventdata,handles)%hObjecthandletoAnalyse(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%---ExecutesonbuttonpressinAnalyse.functionAnalyse_Callback(hObject,eventdata,handles)%hObjecthandletoAnalyse(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLABglobalx;globalX;globalx_flag;globalX_flag;if(x_flag)X=fft(x);X_flag=1;endif(X_flag)stem(handles.FD,linspace(0,2*pi,length(X)),abs(X));xlim(handles.FD,[0,2*pi])end%---ExecutesonbuttonpressinExport.functionExport_Callback(hObject,eventdata,handles)%hObjecthandletoExport(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLABglobalX;globalX_flag;if(X_flag)assignin('base',get(handles.edit4,'String'),X);end%---Executesduringobjectcreation,aftersettingallproperties.functiontext1_CreateFcn(hObject,eventdata,handles)%hObjecthandletotext1(
本文标题:北京理工大学-数字信号处理-实验报告-程序
链接地址:https://www.777doc.com/doc-4591530 .html