

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 论建设工程合同的法律问题
- 便利店加盟合同书样本2025
- 深圳二手房买卖合同要点
- 人才合作合同
- 云南省迪庆2024-2025学年高三下学期第二次调研考试英语试题含解析
- 上海戏剧学院《药物合成反应C》2023-2024学年第二学期期末试卷
- 江西省南昌市10所省重点2025年高三下学期暑假联考物理试题含解析
- 潍坊理工学院《云南原生态民族音乐》2023-2024学年第一学期期末试卷
- 宿松县2024-2025学年小学六年级第二学期小升初数学试卷含解析
- 二手房产合同转让协议书
- 教研项目合同协议
- 腹壁切口疝手术护理查房
- 济南水务集团有限公司招聘笔试真题2024
- 乡村医生药品管理培训
- SL631水利水电工程单元工程施工质量验收标准第4部分:堤防与河道整治工程
- 2025年山东交运怡亚通供应链管理有限公司招聘笔试参考题库含答案解析
- 浙江省嘉兴市2025届高三下学期4月教学测试化学+答案
- 私人水源转让协议合同
- 2025年4月版安全法律法规标准文件清单
- 品管圈PDCA改善案例-降低住院患者跌倒发生率
- 人工智能引论知到智慧树章节测试课后答案2024年秋浙江大学
评论
0/150
提交评论