资源描述:
《利用MATLAB实现数字低通滤波器的设计》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、西南石油大学实验报告课程数字信号处理实验项目利用MATLAB实现数字低通滤波器的设计成绩专业年级通信工程09学号0907050228指导教师姓名王延礼同组人姓名实验日期一实验目的:1学习用Matlab直接设计模拟滤波器和数字滤波器。2学习用冲激响应不变法和双线性变换法的Matlab的实现。二实验内容:设计满足下列指标的数字低通滤波器:Wp=0.2*pi,Rp=1dbWs=0.5*piRs=20dbFs=1khz1.利用B、C1型设计出模拟低通滤波器,采用冲激响应不变法、双线性发转换成数字低通滤波器。2.直接设计出B、C1型数字低通滤波器。三实验步骤:程序1Wp=2*pi*0.
2、1*1000;Ws=2*pi*0.25*1000;Rp=1;Rs=20;[N,Wn]=buttord(Wp,Ws,Rp,Rs,'s');[z,p,k]=buttap(N);[B,A]=butter(N,Wn,'s');freq1=linspace(0,Wp,5);freq2=linspace(Wp,Ws,15);freq3=linspace(Ws,10*pi*2,25);h1=20*log10(abs(freqs(B,A,freq1)));h2=20*log10(abs(freqs(B,A,freq2)));h3=20*log10(abs(freqs(B,A,freq3)))
3、;plot([freq1freq2freq3]/(2*pi),[h1,h2,h3]);grid;Xlabel('FrequencyinHz');Ylabel('gaininDB');图一程序2wp=0.2*pi;ws=0.5*pi;rp=1;rs=20;fs=1000;omegap=wp*fs;omegas=ws*fs;[N,Wn]=buttord(omegap,omegas,rp,rs,'s');[BA]=butter(N,Wn,'s');[b,a]=impinvar(B,A,fs);[h,w]=freqz(b,a,256);h=20*log10(abs(h));plot(
4、w/pi,h);图二程序3wp=0.2*pi;ws=0.5*pi;rp=1;rs=20;fs=1000;omegap=2*fs*tan(wp/2);omegas=2*fs*tan(ws/2);[N,Wn]=cheb1ord(omegap,omegas,rp,rs,'s');[BA]=cheby1(N,rp,Wn,'s');[b,a]=bilinear(B,A,fs);[h,w]=freqz(b,a,256);h=20*log10(abs(h));plot(w/pi,h);图三程序4wp=0.2*pi;ws=0.5*pi;rp=1;rs=20;[N,Wn]=buttord(wp
5、/pi,ws/pi,rp,rs);[BA]=butter(N,Wn);[h,w]=freqz(B,A,256);h=20*log10(abs(h));plot(w/pi,h);图四程序5Wp=0.2*pi;Ws=0.5*pi;Rp=1;Rs=20;T=0.001;Fs=1000;omegap=(2/T)*tan(Wp/2);omegas=(2/T)*tan(Ws/2);[N,Wn]=cheb1ord(omegap,omegas,Rp,Rs,'s');[B,A]=cheby1(N,Rp,Wn,'s');[b,a]=bilinear(B,A,Fs);[h,w]=freqz(b,a
6、,256);h1=20*log10(abs(h));plot(w/pi,h1);grid;xlabel('DigitalFrequencyinpiunits');ylabel('GaininDB');axis([01-5010]);图五程序6Wp=0.2;Ws=0.5;Rp=1;Rs=20;disp('ÇбÈÑ©·òIÐÍ')[N,Wn]=cheb1ord(Wp,Ws,Rp,Rs)[B,A]=cheby1(N,Rp,Wn);disp('ÇбÈÑ©·òÐÍ·Ö×Ó¶àÏîʽ');fprintf('%.4e',B);disp('ÇбÈÑ©·ò·Öĸ¶àÏîʽ');
7、fprintf('%.4e',A);w=linspace(0,0.8*pi,50);h1=20*log10(abs(freqz(B,A,w)));plot(w/pi,h1);grid;xlabel('Normalizedfrequency');ylabel('GaininDB');axis([00.8-501]);图六四、实验小结通过本次实验,对MATLAB软件有了进一步的了解,也在不断的实践中,更多的熟悉了MATLAB的编程,在编程方面一点点的有了进步。只是,还需要课后多加的去研究MATLAB。此