该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
求助:我的滤波器是多通带的,已经设计好了,就是不知道阶数是多少,请帮我分析一下,到底多少阶,请具体说明,谢谢!
N=201;
w1=475;w2=525;w3=975;w4=1025;fs=5000;
k1=ceil(w1*N/fs);k2=ceil(w2*N/fs);k3=ceil(w3*N/fs);k4=ceil(w4*N/fs);
t1=k2-k1+1;t2=k4-k3+1;t3=3;t4=3;
a=0.3229;b=0.3479;
A=[zeros(1,k1-1),a,0.8*ones(1,t1),b,zeros(1,k3-k2-3),a,ones(1,t2),b,zeros(1,114),b,ones(1,t3),a,zeros(1,15),b,0.8*ones(1,t4),a,zeros(1,18)];
theta=-pi*[1:N]*(N-1)/N;
H=A.*exp(-j*theta);
h=real(ifft(H));
v=0:N-1;
figure(2);
plot(v*2*pi/N,A,'k*')
title('频率样本');xlabel('k');ylabel('H(k)');
figure(3);
plot(v,h,'k')
xlabel('n/\pi');ylabel('h(n)');
title('脉冲响应');axis([0,fix(N*1.1),-0.1,0.4]);
M=500;
nx=[1:N];
w=linspace(0,pi,M);
X=h*exp(-j*nx'*w);
figure(4);
plot(w./pi,abs(X),'k')
title('幅度响应');xlabel('\omega/\pi');ylabel('Hd(\omega)');
axis([0,1,-0.1,1.3]);
figure(5);
hn=20*log10(abs(X));
plot(w./pi,hn,'k')
title('幅度响应');xlabel('\omeg/\pi');ylabel('dB');
axis([0,1,-50,10]),grid on;
Y=xinhao;
yy=X.*Y(1:M);
figure(6);
plot(w./pi,abs(yy))
title('滤波效果'),xlabel('rad');