实验之FIR数字滤波器设计实验内容1

2025-10-23 10:46:46

1、 N=15;

 a=0.5*(N-1);

 n=0:N-1;

 wn=pi/4;

 w=sin(wn*(n-a))./(pi*(n-a));

 if rem(N,2)~=0;

 w(a+1)=wn/pi;

 end;

 w1=hamming(N);

 h=w.*w1';

 subplot(3,2,1)

 stem(n,h,'.')

 title('图一 N=15 hamming窗设计的h(n)','FontSize',10,'FontWeight','bold');

 axis([0,14,-0.1,0.3]);

 ylabel('h(n)');

 text(0,0.15,['Made by:邱英尤'],'FontSize',10,'FontWeight','bold');

 grid

 h1=fft(h,512);

 w2=2*[0:511]/512;

 subplot(3,2,3)

 plot(w2,20*log10(abs(h1)))

 title('图二 N=15 幅频曲线','FontSize',10,'FontWeight','bold');

 xlabel('数字频率w/pi');ylabel('幅度/db');

 grid

 subplot(3,2,5)

 plot(w2,angle(h1))

 title('图三 N=15 相频曲线','FontSize',10,'FontWeight','bold');

 xlabel('数字频率w/pi');ylabel('相角/rad');

 grid;

 N=33;

 a=0.5*(N-1);

 n=0:N-1;

 wn=pi/4;

 w=sin(wn*(n-a))./(pi*(n-a));

 if rem(N,2)~=0;

 w(a+1)=wn/pi;

 end;

 w1=hamming(N);

 h=w.*w1';

 subplot(3,2,2);

 stem(n,h,'.');

 title('图四 N=32 hamming窗设计的h(n)','FontSize',10,'FontWeight','bold');

 axis([0,32,-0.1,0.3]);

 grid;

 h1=fft(h,512);

 w2=2*[0:511]/512;

 subplot(3,2,4);

 plot(w2,20*log10(abs(h1)))

 title('图五 N=32 幅频曲线','FontSize',10,'FontWeight','bold');

 xlabel('数字频率w/pi');ylabel('幅度/db');

 grid

 subplot(3,2,6)

 plot(w2,angle(h1))

 title('图六 N=32 相频曲线','FontSize',10,'FontWeight','bold');

 xlabel('数字频率w/pi');ylabel('相角/rad');

 grid;

1

实验之FIR数字滤波器设计实验内容1

2

实验之FIR数字滤波器设计实验内容1

3

实验之FIR数字滤波器设计实验内容1

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢