Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
初级会员
注册日期: 2009-12-06
帖子: 1
声望力: 0 ![]() |
![]()
??? Undefined function or method 'ideal_lpl' for input arguments
of type 'double'. Error in ==> ditong at 8 hd=ideal_lpl(Wc,N); %理想低通滤波器的单位脉冲响应 调试的时候出现上面的问题,不知道是哪错了,那位高手帮帮忙。非常谢谢。 下面是所有程序: clear all; Wp=0.2*pi; Ws=0.4*pi; tr_width=Ws-Wp;%过渡带宽度 N=ceil(6.6*pi/tr_width)+1;%滤波器长度 n=0:1:N-1; Wc=(Ws+Wp)/2; %理想低通滤波器的截止频率 hd=ideal_lpl(Wc,N); %理想低通滤波器的单位脉冲响应 w_ham=(hamming(N))'; %海明窗 h=hd.*w_ham;%截取得到实际的单位脉冲响应 [db,mag,pha,w]=freqz_m2(h,[1]);%计算实际滤波器的单位脉冲响应 delta_w=2*pi/1000; Rp=-(min(db(1:1:Wp/delta_w+1)));%实际通带波纹 As=-round(max(db(Ws/delta_w+1:1:501)));%实际阻带波纹 subplot(2,2,1); stem(n,hd); title('理想单位脉冲响应hd(n)'); subplot(2,2,2); stem(n,w_ham); title('海明窗w(n)'); subplot(2,2,3); stem(n,h); title('实际单位脉冲响应hd(n)'); subplot(2,2,4); plot(w/pi,db); title('幅度响应(dB)'); axis([0,1,-100,10]); ![]() ![]() ![]() |
![]() |
![]() |