?? problem6_23.m
字號:
%========================================================================
% program name:problem6_23.m
%========================================================================
clear,close all,
dw=0.05;dt=0.01;w0=6;t0=30;t=-t0:dt:t0;
w=-w0:dw:w0;L=length(w);
H1=u(w+2)-u(w-2-dw);
phai=w*0.2;
phai=0;
%phai=((-pi/2)*u(-w)+(pi/2)*u(w));phai((L-1)/2)=0;
H=H1.*exp(j*phai);
h=H*exp(j*w'*t)*dw/(2*pi);
subplot(221)
plot(w,H1),title('The magnitude response of the filter')
axis([-4,4,0,1.1]),grid on,
subplot(222)
plot(w,phai),title('The phase response of the filter')
axis([-4,4,-1.1*pi/2,1.1*pi/2]),grid on,
subplot(224)
plot(t,real(h)),axis([-6,6,min(real(h)),max(real(h))]),grid on,
title('The impulse response of the filter')
subplot(223)
H=real(h)*exp(-j*t'*w)*dt;
plot(w,abs(H)),axis([-4,4,0,max(abs(H))]),grid on,
title('The magnitude response from h(t)')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -