版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、封面仅供个人学习作者:PanHongliangDigital sig nal andanalysisTitle:A filter and equilizerName:Yan gxiaoClass:Master of mecha ni cal engin eeri ng 1302Student ID:M201370503Abstrac:tDesigning some kinds of filters by using matlab.We canunderstand the signal processing of filter more comprehensive by analyzingthe
2、 filtering properties of different filters.Designing anadjustable parameterof digital filter which is called equalizer.In this paper, the digital equalizerwhich is based on MATLAB platform designing has the functionsofaccessing Wav file , filtering and playing.Keyword:Matlab,Filter,Equalizer1. Prefa
3、ceMATLAB is called Matrix Laborator,y which is designed by the UnitedStates MathWorks company.Its a commercial mathematical software.Matlab can be use for Matrix operations, mapping functions and data,algorithm, creating the user interface, connect to other programminglanguages procedures, mainly us
4、ed in engineering calculations, controldesign, signal processing and communications, image processing, signaldetection, design and financial modeling analysis and other fields. GUI(Graphical User Interface, referred to as GUI, known Graphical UserInterface) is displayed using the graphical user inte
5、rface of computeroperations. Matlab has a powerful GUl tool. In this report, by using matlabGUI 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 allows signal in low frequency or dc compone
6、nt through, suppress the high freque ncy comp onent or the interferenceand noise.High-pass filter: it allows the signal in high freque ncy , restrainlow freque ncy or dc comp onen t.Ba nd-pass filter: it allows a spectrum ofsig nal through and restra in the sig nal below or above the spectrum,interf
7、erence and noise.Band-stop filter: it inhibit the signal within a certainfrequency band and pass the signal outside the spectrum.2. IntroduceThe filter which is designed by using matlab have four functions :low-pass,high-pass,ba nd-stop and ban d-pass .Every fun cti on could in put thecut-off freque
8、 ncies.The equalizer could filter the wav file in putted as we wan t.The in terface is that:2.1 In terface3. Design PrinciplesThe task is to design the filter and equalizer which can edit thein putt ing sig nal as we want and choose the freque ncy spectrum to pass.3.1 the standard signal inputWe des
9、ig n a sig nal gen erator which is used to gen erator sta ndardwaveform such as sin ,square,tria ngular,sawtooth and no ise.A nd we candecide whether addi ng differe nt waves .The program is:Fs=10000N=400。x=linspace(0,N/Fs,N)。t=get(handles.WaveMake,Value。)f=str2double(get(handles.frequency,String)。)
10、a=str2double(get(handles.amplitude,String)。) p=0。switch tcase 1y=a*sin(2*pi*x*f+p) 。if get(handles.add,Value)=0.0 handles.y=y。elsehandles.y=handles.y+y。endcase 2 case 5y=a*(2*rand(size(x)-1) 。if get(handles.add,Value)=0.0 handles.y=y。elsehandles.y=handles.y+y。endendhandles.inputtype=3。guidata(hObjec
11、t,handles)。 plot(handles.axes1,handles.y。)xlim(0 200) 。temple=handles.y。f=linspace(0,Fs/2,N/2)。P=2*fft(temple,N)/N 。Pyy=sqrt(P.* conj(P)。plot(handles.axes2,f,Pyy(1:N/2)。The interface is:3.1 the image of waveform3.2 the wave filteringBy choosing the working mode of filter and input cut-off frequencie
12、s wecan realize the filtering.Theprogram is:y=handles.y。FC=str2double(get(handles.hf,string)。Fs=22000。n=44100。N=8 。Wn=FC/(Fs/2)。% the low-pass programb,a = butter(N,Wn,low) 。 z=filter(b,a,y) 。P=fft(z,n) 。 f=linspace(0,Fs/2,n/2)。Pyy=2*sqrt(P.* conj(P)/n 。 plot(handles.axes3,z。)plot(handles.axes4,f,Py
13、y(1:n/2)。 handles.z=z。guidata(hObject,handles)。By running the program we can realize low-pass filter3.2 the image of low-pass filterThe high-pass program is: b,a = butter(N,Wn,high) 。 z=filter(b,a,y) 。P=fft(z,n) 。 f=linspace(0,Fs/2,n/2)。Pyy =2*sqrt(P.* conj(P)/n 。 plot(handles.axes3,z。)plot(handles.
14、axes4,f,Pyy(1:n/2)。 handles.z=z。guidata(hObject,handles)。By running the program we can realize high-pass filter3.3 the image of high-pass filterThe band-stop program is:b,a = butter(N,Wn,stop)。z=filter(b,a,y) 。P=fft(z,n) 。f=linspace(0,Fs/2,n/2)。Pyy=2*sqrt(P.* conj(P)/n 。plot(handles.axes3,z。 ) plot(
15、handles.axes4,f,Pyy(1:n/2)。handles.z=z。guidata(hObject,handles。)By running the program we can realize band-stop filter3.4 the image of band-stop filterThe band-pass program is: b,a = butter(N,Wn,bandpass)。z=filter(b,a,y) 。P=fft(z,n) 。f=linspace(0,Fs/2,n/2)。handles.Pyy=2*sqrt(P.* conj(P)/n 。plot(hand
16、les.axes3,z。)plot(handles.axes4,f,handles.Pyy(1:n/2)。)handles.z=z。guidata(hObject,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)
17、。if isequal(filename,0)disp(the user cancels to select。)elsestr=strcat(pathname,filename。) disp(strcat(the user select ,str)。)set(handles.filename,string,str。)endy,Fs,bits=wavread(str)。handles.y=y。handles.z=y。guidata(hObject,handles)。When we choose a wav file, we can realize equalizer filter by sett
18、ingthe values of The scroll bars and run the program:handles.a=handles.y(:,1。) y=handles.a。 l=length(y) 。Fs=44100。%t=(0:l-1)/Fs 。Y=zeros(size(y)。A1=get(handles.slider1,value)。b,a=butter(2,30/(Fs/2),60/(Fs/2),bandpass)。Y=Y+2*A1*filter(b,a,y) 。A2=get(handles.slider2,value)。b,a=butter(2,60/(Fs/2),100/(
19、Fs/2),bandpass)。Y=Y+2*A2*filter(b,a,y) 。A3=get(handles.slider3,value)。b,a=butter(2,100/(Fs/2),200/(Fs/2),bandpass。)Y=Y+2*A3*filter(b,a,y) 。A4=get(handles.slider4,value)。b,a=butter(2,200/(Fs/2),500/(Fs/2),bandpass。)Y=Y+2*A4*filter(b,a,y) 。A5=get(handles.slider5,value)。b,a=butter(2,500/(Fs/2),1000/(Fs
20、/2),bandpass。)Y=Y+2*A5*filter(b,a,y) 。A6=get(handles.slider6,value)。b,a=butter(2,1000/(Fs/2),2000/(Fs/2),bandpass。)Y=Y+2*A6*filter(b,a,y) 。A7=get(handles.slider7,value)。b,a=butter(2,2000/(Fs/2),4000/(Fs/2),bandpass。)Y=Y+2*A7*filter(b,a,y) 。A8=get(handles.slider8,value)。b,a=butter(2,4000/(Fs/2),8000/
21、(Fs/2),bandpass。)Y=Y+2*A8*filter(b,a,y) 。z=Y。Fs=44100。ysize=size(handles.y)。 N=str2double(num2str(ysize(1)。wavplay(z,Fs)。P=fft(y,N) 。Pyy1=2*sqrt(P.*conj(P)/N 。P=fft(z,N) 。Pyy =2*sqrt(P.* conj(P)/N 。 f=linspace(0,Fs/2,N/2)。%Original wave time=(1:length(y)/Fs 。 plot(handles.axes1,time,y)。%Original fre
22、quencyplot(handles.axes2,f,Pyy1(1:N/2)。%The equilizer wave plot(handles.axes3,time,z)。%The equilizer frequency plot(handles.axes4,f,Pyy(1:N/2)。guidata(hObject,handles)。The interface is:3.6 the image of equalizerWe can see the equalizer realize the function of frequency filtering well.4 .Exist proble
23、mThe 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. ConclusionWith the complement of the third project, the whole projects in thecourse have been finished.From the beginning when I dont know thecont
24、ent as well as the soft matlab very much ,in the end when I havecomplete all the projects with the matlab,it is really not easy.There is no need to say that I can make a simple system with the softmatlab now. The last one ,the filter and equalizer is the combination of thekno wledge that is obta ine
25、d from the desig ning the first two projects.With the basis of kno wledge in the course as well as matlab, I will not beafraid of the problem. Nothing is impossible to a willing mind. If we make upour mi nds to do a thi ng ,we will solve all the problems in the last.References1薛山.MATLAB 基础教程.M北京:清华大
26、学出版社,2011.3版权申明本文部分内容,包括文字、图片、以及设计等在网上搜集整 理。版权为潘宏亮个人所有This article includes some parts, including text, pictures, and desig n.Copyright is Pan Hon glia ngs pers onal own ership.用户可将本文的内容或服务用于个人学习、研究或欣赏,以及 其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关 法律的规定,不得侵犯本网站及相关权利人的合法权利。除此以 外,将本文任何内容或服务用于其他用途时,须征得本人及相关权 利人的书面许可,并支付报酬。Users may use the contents or services o
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026中煤鄂尔多斯能源化工有限公司面向中国中煤内部及社会招聘7人备考题库及答案详解(网校专用)
- 2026四川高能智盾科技有限公司招聘财务专员1人备考题库附答案详解(综合卷)
- 2026广东技术师范大学招聘教学科研人员75人备考题库含答案详解(达标题)
- 2026安徽淮南市消防救援局政府专职消防员招聘49人备考题库及答案详解(新)
- 2026河南郑州市城市照明和绿化景观服务中心公益性岗位招聘8人备考题库及答案详解(典优)
- 2026浙江宁波市慈城镇人民政府招聘合同制人员11人备考题库及答案详解(名师系列)
- 2026浙江杭州市文三教育集团定山小学招聘语文老师(非事业)1人备考题库及答案详解(典优)
- 2026内蒙古锡林郭勒盟言信人力资源服务有限公司招聘6人备考题库及完整答案详解
- 2026广西贵港桂平市建筑工程质量安全监督站招聘见习人员3人备考题库及答案详解(全优)
- 2026湖南娄底市市直学校公开招聘工作人员15人备考题库及1套参考答案详解
- 2026年岭南版小学二年级美术下册(全册)每课教学设计(附目录)
- 2026届云南省名校联盟高考下学期备考诊断性联考模拟预测历史试题(含答案)
- 围挡清洗施工方案(3篇)
- 2026中国记协机关服务中心招聘4人笔试备考题库及答案解析
- 《胡萝卜先生的长胡子(第二课时)》课件
- 2026届北京市海淀区重点达标名校初三数学试题下学期第一次月考数学试题含解析
- 《中华人民共和国危险化学品安全法》解读课件
- 户外直播安全合同协议书模板
- GB 14881-2025食品安全国家标准食品生产通用卫生规范
- 受限空间作业审批制度
- 中国历史常识考试题库(500题)
评论
0/150
提交评论