资源预览内容
第1页 / 共15页
第2页 / 共15页
第3页 / 共15页
第4页 / 共15页
第5页 / 共15页
第6页 / 共15页
第7页 / 共15页
第8页 / 共15页
第9页 / 共15页
第10页 / 共15页
亲,该文档总共15页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
仅供个人学习作者: Pan HongliangDigital sig nal andan alysisTitle:A filter and equilizerName:Class:Master of mecha ni cal engin eeri ng 1302Student ID:M201370503AbstractDesigning some kinds of filters by using matlab.We can understand the signal processing of filter more comprehensive by analyzing the filtering properties of different filters.Designing an adjustable parameter of digital filter which is called equalizer.In this paper, the digital equalizer which is based on MATLAB platform designing has the functions of accessing Wav file , filtering and playing. KeywordMatlab,Filter,Equalizer1. PrefaceMATLAB is called Matrix Laboratory which is designed by the United States MathWorks compa nya commercial mathematical software. Matlab can be use for Matrix operations, mapping functions and data, algorithm, creat ing the user in terface, conn ect to other program ming Ianguages procedures, mainly used in engineering calculations, control desig n, sig nal process ing and com muni cati on s, image process ing, sig nal detection, design and financial modeling analysis and other fields. GUI (Graphical User In terface, referred to as GUI, known Graphical User In terface) is displayed using the graphical user in terface 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 and band-stop filter.Low-pass filter: it allows signal in low frequency or dc comp onent through, suppress the high freque ncy comp onent or the interferenee and noise.High-pass filter: it allows the signal in high freque ncy , restrain low freque ncy or de comp onen t.Ba nd-pass filter: it allows a spectrum of sig nal through and restra in the sig nal 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 fourfun cti ons :low-pass,high-pass,ba nd-stop and ban d-pass .Every fun cti on could in put the cut-off freque ncies .The equalizer could filter the wav file in putted as we want.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 desig n a sig nal gen erator which is used to gen erator sta ndard waveform such as sin ,square,tria ngular,sawtooth and no ise.A nd we can decide whether addi ng differe nt waves .The program is:Fs=10000;N=400;x=li nspace(O,N/Fs,N);t=get(ha ndles.WaveMake,Value);f=str2double(get(ha ndles.freque ncy,Stri ng); a=str2double(get(ha ndles.amplitude,Stri ng); p=0;switch tcase 1y=a*si n(2*pi*x*f+p);if get(ha ndles.add,Value)=0.0han dles.y=y;elsehan dles.y=ha ndles.y+y;endcase 2 case 5y=a*(2*ra nd(size(x)-1);if get(ha ndles.add,Value)=0.0han dles.y=y;elsehan dles.y=ha ndles.y+y;endendhan dles.i nputtype=3;guidata(hObject,ha ndles);plot(ha ndles.axes1,ha ndles.y);xlim(O 200);temple二ha ndles.y;f=li nspace(0,Fs/2,N/2);P=2*fft(temple,N)/N;Pyy=sqrt(P.* conj(P);plot(ha ndles.axes2,f,Pyy(1:N/2);The in terface is:3.1 the image of waveform3.2 the wave filteringBy choos ing the work ing mode of filter and in put cut-off freque ncies we can realize the filtering.Theprogram is:y=ha ndles.y;FC=str2double(get(ha ndles.hf,stri ng);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=li nspace(0,Fs/2, n/2);Pyy=2*sqrt(P.* conj(P)/n;plot(ha ndles.axes3,z);plot(ha ndles.axes4,f,Pyy(1: n/2);han dles.z=z;guidata(hObject,ha ndles);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=li nspace(0,Fs/2 ,n/2);Pyy =2*sqrt(P.* conj(P)/n;plot(ha ndles.axes3,z);plot(ha ndles.axes4,f,Pyy(1: n/2);han dles.z=z;guidata(hObject,ha ndles);By running the program we can realize high-pass filter3.3 the image of high-pass filterThe ban d-stop program is:b,a = butter(N,Wn,stop);z=filter(b,a,y);P=fft(z,n);f=li nspace(0,Fs/2 ,n/2);Pyy=2*sqrt(P.* conj(P)/n;plot(ha ndles.axes3,z);plot(ha ndles.axes4,f,Pyy(1: n/2);han dles.z=z;guidata(hObject,ha ndles);By running the program we can realize ban d-stop filter3.4 the image of ban d-stop filterThe ban d-pass program is:b,a = butter(N,Wn,ba ndpass);z=filter(b,a,y);P=fft(z,n);f=li nspace(0,Fs/2 ,n/2);han dles.Pyy=2*sqrt(P.* conj(P)/n;plot(ha ndles.axes3,z);plot(ha ndles.axes4,f,ha ndles.Pyy(1: n/2);han dles.z二z;guidata(hObject,ha ndles);By running the program we can realize ban d-pass filter3.5 the image of
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号