《2022年matlab滤波器与均衡器设计方案.docx》由会员分享,可在线阅读,更多相关《2022年matlab滤波器与均衡器设计方案.docx(19页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精品学习资源封面欢迎下载精品学习资源作者: PanHongliang仅供个人学习欢迎下载精品学习资源Digital signal andanalysisTitle:A filter and equilizerName:YangxiaoClass:Master of mechanical engineering 1302StudentID:M202170503欢迎下载精品学习资源Abstrac:tDesigning somekinds offiltersbyusingmatlab.We can understand thesignal processing offiltermorecompreh
2、ensive by analyzingthefilteringpropertiesofdifferentfilters.Designing anadjustable parameter of digital filter which is called equalizer.In this paper, the digital equalizer which is based on MATLAB platform designing has the functions ofaccessing Wav file , filtering and playing.欢迎下载精品学习资源Keyword:M
3、atlab,Filter,Equalizer1.PrefaceMATLAB is called Matrix Laborator,ywhich is designed by the欢迎下载精品学习资源United States MathWorks company.Its a commercial mathematical software. Matlab can be use for Matrix operations, mapping functionsand data, algorithm, creating the user interface, connect to other pro
4、gramming languages procedures, mainly used in engineering calculations, control design, signal processing and communications, image processing, signal detection, design and financial modeling analysis and other fields. GUI Graphical User Interface, referred to as GUI, known Graphical User Interface
5、is displayed using the graphical user interface of computer operations. Matlab has a powerful GUl tool. In this report, by using matlab GUI tool we could design a signal filter and equalizer.The filter Can be divided into low-pass, high-pass filter, band pass andband-stop filter.Low-pass filter: it
6、allows signal in low frequency or dc欢迎下载精品学习资源component through, suppress the high frequency component or the interference and noise.High-pass filter: it allows the signal in high frequency , restrain low frequency or dc component.Band-pass filter: it allows a spectrum of signal through and restrain
7、 the signal below or above the spectrum, interference and noise.Band-stop filter: it inhibit the signal within a certain frequency band and pass the signal outside the spectrum.2. IntroduceThe filter which is designed by using matlab have four functions :low- pass,high-pass,band-stop and band-pass .
8、Every function could input the cut-off frequencies.The equalizer could filter the wav file inputted as we want.The interface is that:欢迎下载精品学习资源3. Design Principles2.1 Interface欢迎下载精品学习资源The task is to design the filter and equalizer which can edit the inputting signal as we want and choose the frequ
9、ency spectrum to pass.3.1 the standard signal inputWe design a signal generator which is used to generator standard waveform such as sin,square,triangular,sawtooth and noise.And we can decide whether adding different waves .The program is:Fs=10000;欢迎下载精品学习资源N=400;x=linspace0,N/Fs,N;t=gethandles.Wave
10、Make,Value;f=str2doublegethandles.frequency,String;a=str2doublegethandles.amplitude,String; p=0;switch tcase 1y=a*sin2*pi*x*f+p;if gethandles.add,Value=0.0 handles.y=y;elsehandles.y=handles.y+y; endcase 2.case 5y=a*2*randsizex-1 ;if gethandles.add,Value=0.0 handles.y=y;elsehandles.y=handles.y+y;欢迎下载
11、精品学习资源endend handles.inputtype=3;guidatahObject,handles;plothandles.axes1,handles.y; xlim0 200 ;temple=handles.y;f=linspace0,Fs/2,N/2;P=2*ffttemple,N/N ;Pyy=sqrtP.* conjP;plothandles.axes2,f,Pyy1:N/2;The interface is:3.1 the image of waveform3.2 the wave filteringBy choosing the working mode of filt
12、er and input cut-off frequencies we can realize the filtering.Theprogram is:y=handles.y;FC=str2doublegethandles.hf,string;Fs=22000;n=44100;N=8;Wn=FC/Fs/2;欢迎下载精品学习资源% the low-pass program b,a = butterN,Wn,low ;z=filterb,a,y ;P=fftz,n ;f=linspace0,Fs/2,n/2;Pyy=2*sqrtP.* conjP/n;plothandles.axes3,z;plo
13、thandles.axes4,f,Pyy1:n/2;handles.z=z;guidatahObject,handles;By running the program we can realize low-pass filter3.2 the image of low-pass filter The high-pass program is:b,a = butterN,Wn,high ;z=filterb,a,y ;P=fftz,n;f=linspace0,Fs/2,n/2;Pyy =2*sqrtP.* conjP/n;plothandles.axes3,z;plothandles.axes4
14、,f,Pyy1:n/2;handles.z=z;guidatahObject,handles;欢迎下载精品学习资源By running the program we can realize high-pass filter3.3 the image of high-pass filter The band-stop program is:b,a = butterN,Wn,stop;z=filterb,a,y ;P=fftz,n;f=linspace0,Fs/2,n/2;Pyy=2*sqrtP.* conjP/n;plothandles.axes3,z;plothandles.axes4,f,P
15、yy1:n/2;handles.z=z;guidatahObject,handles;By running the program we can realize band-stop filter3.4 the image of band-stop filter The band-pass program is:b,a = butterN,Wn,bandpass;z=filterb,a,y ;P=fftz,n;f=linspace0,Fs/2,n/2;handles.Pyy=2*sqrtP.* conjP/n ;plothandles.axes3,z;欢迎下载精品学习资源plothandles.
16、axes4,f,handles.Pyy1:n/2;handles.z=z;guidatahObject,handles;By running the program we can realize band-pass filter3.5 the image of band-pass filter3.3 the equalizer filteringWe can open a wav file by run this program: filename,pathname=uigetfile*.wav,select a wavfile ;if isequalfilename,0dispthe use
17、r cancels to select;elsestr=strcatpathname,filename;dispstrcatthe user select ,str;sethandles.filename,string,str;end y,Fs,bits=wavreadstr;handles.y=y;handles.z=y;guidatahObject,handles;When we choose a wav file, we can realize equalizer filter by setting the values of The scroll bars and run the pr
18、ogram:欢迎下载精品学习资源handles.a=handles.y:,1;y=handles.a;l=lengthy ;Fs=44100;%t=0:l-1/Fs ;Y=zerossizey;A1=gethandles.slider1,value;b,a=butter2,30/Fs/2,60/Fs/2,bandpass;Y=Y+2*A1*filterb,a,y;A2=gethandles.slider2,value;b,a=butter2,60/Fs/2,100/Fs/2,bandpass;Y=Y+2*A2*filterb,a,y;A3=gethandles.slider3,value;b,
19、a=butter2,100/Fs/2,200/Fs/2,bandpass;Y=Y+2*A3*filterb,a,y;A4=gethandles.slider4,value;b,a=butter2,200/Fs/2,500/Fs/2,bandpass;Y=Y+2*A4*filterb,a,y;A5=gethandles.slider5,value;b,a=butter2,500/Fs/2,1000/Fs/2,bandpass;Y=Y+2*A5*filterb,a,y;A6=gethandles.slider6,value;欢迎下载精品学习资源b,a=butter2,1000/Fs/2,2000/
20、Fs/2,bandpass;Y=Y+2*A6*filterb,a,y;A7=gethandles.slider7,value;b,a=butter2,2000/Fs/2,4000/Fs/2,bandpass;Y=Y+2*A7*filterb,a,y;A8=gethandles.slider8,value;b,a=butter2,4000/Fs/2,8000/Fs/2,bandpass;Y=Y+2*A8*filterb,a,y;z=Y ;Fs=44100;ysize=sizehandles.y;N=str2doublenum2strysize1;wavplayz,Fs;P=ffty,N ;Pyy
21、1=2*sqrtP.*conjP/N ;P=fftz,N ;Pyy =2*sqrtP.* conjP/N ;f=linspace0,Fs/2,N/2;%Original wave time=1:lengthy/Fs ;plothandles.axes1,time,y;%Original frequency欢迎下载精品学习资源plothandles.axes2,f,Pyy11:N/2;%The equilizer wave plothandles.axes3,time,z;%The equilizer frequencyplothandles.axes4,f,Pyy1:N/2;guidatahO
22、bject,handles;The interface is:3.6 the image of equalizerWe can see the equalizer realize the function of frequency filtering well.4 .Exist problemThe interfaces are not enough beautifulThe equlizer cannt realize Pause, fast forward, and so on. The spectrum of music cannot be updated in real time.5.
23、 ConclusionWith the complement of the third project, the whole projects in the course have been finished.From the beginning when I dont know the content as well as the soft matlab very much ,in the end when I have complete all the projects with the matlab,it is really not easy.There is no need to sa
24、y that I can make a simple system with the soft matlab now. The last one ,the filter and equalizer is the combination of欢迎下载精品学习资源the knowledge that is obtained from the designing the first two projects.With the basis of knowledge in the course as well as matlab, I will not be afraid of the problem.
25、 Nothing is impossible to a willing mind. If we make up our minds to do a thing ,we will solve all the problems in the欢迎下载精品学习资源last.References欢迎下载精品学习资源1 薛山. MATLAB 基础教程 .M 北京:清华高校出版社, 2021.3版权申明本文部分内容,包括文字、图片、以及设计等在网上搜集整理;版权为潘宏亮个人全部This article includes some parts, including text, pictures, and de
26、sign. Copyright is Pan Hongliangs personal ownership.用户可将本文的内容或服务用于个人学习、争论或观看,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵害本网站及相关权益人的合法权益;除此以 外,将本文任何内容或服务用于其他用途时,须征得本人及相关权益人的书面许可,并支付酬劳;Users may use the contents or services of this article for personal study, research or appreciation, and other non-comm
27、ercial or non-profit purposes, but at the same time, they shall abide by the provisions of copyright欢迎下载精品学习资源law and other relevant laws, and shall not infringe upon the legitimate rights of this website and its relevant obligees. In addition, when any content or service of this article is used for
28、 other purposes, written permission and remuneration shall be obtained from the person concerned and the relevant obligee.转载或引用本文内容必需是以新闻性或资料性公共免费信息为使用目的的合理、善意引用,不得对本文内容原意进行曲解、修 改,并自负版权等法律责任;Reproduction or quotation of the content of this article must be reasonable and good-faith citation for the use of news or informative public free information. It shall not misinterpret or modify the original intention of the content of this article, and shall bear legal liability such as copyright.欢迎下载