版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、封面僅供個(gè)人學(xué)習(xí)作者: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 基礎(chǔ)教程.M北京:清華大
26、學(xué)出版社,2011.3版權(quán)申明本文部分內(nèi)容,包括文字、圖片、以及設(shè)計(jì)等在網(wǎng)上搜集整 理。版權(quán)為潘宏亮個(gè)人所有This article includes some parts, including text, pictures, and desig n.Copyright is Pan Hon glia ngs pers onal own ership.用戶可將本文的內(nèi)容或服務(wù)用于個(gè)人學(xué)習(xí)、研究或欣賞,以及 其他非商業(yè)性或非盈利性用途,但同時(shí)應(yīng)遵守著作權(quán)法及其他相關(guān) 法律的規(guī)定,不得侵犯本網(wǎng)站及相關(guān)權(quán)利人的合法權(quán)利。除此以 外,將本文任何內(nèi)容或服務(wù)用于其他用途時(shí),須征得本人及相關(guān)權(quán) 利人的書面許可,并支付報(bào)酬。Users may use the contents or services o
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年金屬礦探礦權(quán)轉(zhuǎn)讓框架合同范本3篇
- 2024沈陽二手房買賣合同附帶房屋過戶稅費(fèi)承擔(dān)協(xié)議3篇
- 2024年某大型水電站勞務(wù)分包合同版
- 2024車牌租賃詳細(xì)協(xié)議
- 2024裝卸承包協(xié)議書范本
- 2025年四川省瀘州市九年級(jí)英語寒假作業(yè)四
- 2024甲午雙方關(guān)于區(qū)塊鏈技術(shù)在供應(yīng)鏈管理的應(yīng)用合同
- 2024餐飲業(yè)原料采購長期合作協(xié)議
- 湖南鐵路科技職業(yè)技術(shù)學(xué)院《癌癥的生物學(xué)基礎(chǔ)》2023-2024學(xué)年第一學(xué)期期末試卷
- 2024年餐廳與服務(wù)員雇傭協(xié)議3篇
- 浙江省金華市婺城區(qū)2024-2025學(xué)年九年級(jí)上學(xué)期期末數(shù)學(xué)試卷(含答案)
- 天津市河西區(qū)2024-2025學(xué)年高二上學(xué)期1月期末英語試題(含答案無聽力音頻及聽力原文)
- 2025屆高考語文復(fù)習(xí):信息類文本五大類型的主觀題 課件
- 滬教版小學(xué)數(shù)學(xué)三(下)教案
- 中鐵開投、中鐵云投招聘筆試沖刺題2025
- 2024-2025年度村支書工作述職報(bào)告范文二
- 陜西省西安市高新一中2024-2025學(xué)年九年級(jí)上學(xué)期綜合素養(yǎng)評(píng)價(jià)(三)化學(xué)試卷(含答案)
- 重慶市2023-2024學(xué)年七年級(jí)上學(xué)期期末考試數(shù)學(xué)試題(含答案)
- 安徽省合肥市蜀山區(qū)2023-2024學(xué)年五年級(jí)上學(xué)期期末質(zhì)量檢測科學(xué)試題
- 高數(shù)(大一上)期末試題及答案
- 員工工資條模板
評(píng)論
0/150
提交評(píng)論