相关代码 |
|
% ex_07_03_2.m : 习题 7.3 clear all; fl=pi/6;fh=pi/3;N=29; factor=(N+1)/2;m=factor*fl/pi; m=floor(m);m2=factor*fh/pi;m2=ceil(m2); j=sqrt(-1); for k=0:(N-1) if((k=(N-m))||((k>=m2)&&(k a=-j*(N-1)*k*pi/N; H(k+1)=exp(a); else H(k+1)=0; end end; for i=0:(N-1) s=0; for k=0:(N-1) a=j*2*pi*i*k/N; s=s+H(k+1)*exp(a); end h(i+1)=s/N; end h=real(h);h1=freqz(h,1,N); t=0:0.5/N:0.5-0.5/N; figure('color','w'); subplot(221);plot(t,abs(h1));grid;
相关资源 |
|