DTFT Computation Using MATLAB Example Plot magnitude and phase of the DTFT 0.008-0.033e-0+005e720 0.033-/30+0008e-40 X(e)= 1+2.37e10+27e/20 +16c-30041e/40 Copyright C 2001, S K. Mitra
Copyright © 2001, S. K. Mitra 11 DTFT Computation Using MATLAB • Example - Plot magnitude and phase of the DTFT − − − − − − − − + + + + − + − + = 3 4 2 3 4 2 1.6 0.41 1 2.37 2.7 0.033 0.008 0.008 0.033 0.05 ( ) j j j j j j j j j e e e e e e e e X e
DTFT Computation Using MATLAB >>num=0.008-0.0330.050.0330.008]; >>den=[12372.7160.41] >>0m=[O:p/256:p]; >>H=freqz(num, den, om); >>figure(1) > plot(om/pi, abs(H), LineWidth, 2) > Xlabel( omega/pi) > ylabel( H(e nomega,) > title(Magnitude Response) >>grid on Copyright C 2001, S K. Mitra
Copyright © 2001, S. K. Mitra 12 DTFT Computation Using MATLAB >> num=[0.008 -0.033 0.05 -0.033 0.008]; >> den=[1 2.37 2.7 1.6 0.41]; >> om=[0:pi/256:pi]; >> H=freqz(num,den,om); >> figure(1) >> plot(om/pi,abs(H),'LineWidth',2) >> xlabel('\omega/\pi') >> ylabel('|H(e^{j\omega})|') >> title('Magnitude Response') >>grid on
DTFT Computation Using MATLAB Magnitude Response 09 0.8 0.7 0.6 ======= 如.0.5 工 0.4 0.3 0.2 ======== 0.102030.40.50.6 70.80.9 0/ 13 Copyright C 2001,SKM
Copyright © 2001, S. K. Mitra 13 DTFT Computation Using MATLAB
DTFT Computation Using MATLAB >>figure(2) > plot(om/pi,angle(), LineWidth, 2 > Xlabel( omega/pir) > ylabel('phase((e nomegal) > title( Phase Response) > grid on 14 Copyright C 2001, S K. Mitra
Copyright © 2001, S. K. Mitra 14 DTFT Computation Using MATLAB >> figure(2) >> plot(om/pi,angle(H),'LineWidth',2) >> xlabel('\omega/\pi') >> ylabel('phase(H(e^{j\omega}))') >> title('Phase Response') >> grid on
DTFT Computation Using MATLAB Phase Resp 0 0.102030.40.50.60.70.80.9 0/丌 15 Copyright C 2001, S K. Mitra
Copyright © 2001, S. K. Mitra 15 DTFT Computation Using MATLAB