<P><FONT size=3><FONT size=4>先谢谢大家了 这段程序是我在一本书上看来的 具体是这样的</FONT><BR>function hlp=idllp(wc,M)<BR>a=(M-1)/2;<BR>n=[0:1:(M-1)];<BR>m=n-a+eps;<BR>hlp=sin(wc*m)./(pi*N);<BR>%====================================================================================================<BR>function [db,mag,pha,w]=freqzdb(b,a,M)<BR>[H,w]=freqz(b,a,M);<BR>H=H';w=w';<BR>mag=abs(H);<BR>db=20*log10((mag+eps)/max(mag));<BR>pha=angle(H);<BR>%====================================================================================================<BR>function [beta,M]=lpf_kaiser(wp,ws,Ap,As)<BR>deltaf=(ws-wp)/(2*pi);<BR>deltap=(10^(Ap/20)-1)/(10^(Ap/20)+1);<BR>deltas=10^(-As/20);<BR>delta=min(deltap,deltas);<BR>A=-20*log10(delta);<BR>M=ceil((A-7.95)/(14.36*deltaf))+1;<BR>if mod(M,2)==0;<BR> M=M+1;<BR>end<BR>if A>=50<BR> beta=0.1102*(A-8.7);<BR>elseif A>21<BR> beta=0.5842*(A-21)^0.4+0.07886*(A-21);<BR>else<BR> beta=0;<BR>end <BR><FONT size=4>但是一直有错误显示<BR></FONT>??? Input argument 'M' is undefined.</FONT></P>
<P><FONT size=3>Error in ==> d:\MATLAB6p1\work\f1.m<BR>On line 2 ==> a=(M-1)/2;</FONT></P> |