filter
代码说明:
M=63 J=(M-1)/2 Wp=0.5*pi Ws=0.6*pi Np=100 Ns=100 weightp=1 weights=100 通带和阻带的加权系数 WpN=linspace(0,Wp,Np) WsN=linspace(Ws,pi-0.05,Ns) Wm=[WpN WsN] p=[ones(1,50),ones(1,50)/2] d=[p,zeros(1,Ns)] W=diag([weightp*ones(1,Np),weights*ones(1,Ns)]) C=cos(Wm*[0:J]) Q=diag(cos(Wm*0.5)) g=(W*Q*C)(W*d) g=g h=(g(J:-1:2)+g(J+1:-1:3))/4 h=[g(J+1)/4 h g(1)*0.5+g(2)/4] h=[h fliplr(h)] W=linspace(0,pi-0.1,512) H=freqz(h,1,W) plot(W/pi,20*log10(abs(H))) (filter design)
下载说明:请别用迅雷下载,失败请重下,重下不扣分!