实验之FIR数字滤波器设计实验内容1
来源:网络收集 点击: 时间:2024-06-01N=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();
ylabel(h(n));
text(0,0.15,,FontSize,10,FontWeight,bold);
grid
h1=fft(h,512);
w2=2*/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();
grid;
h1=fft(h,512);
w2=2*/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;
B.运行结果:1/3


版权声明:
1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。
2、本站仅提供信息发布平台,不承担相关法律责任。
3、若侵犯您的版权或隐私,请联系本站管理员删除。
4、文章链接:http://www.1haoku.cn/art_868595.html