Time Domain Representation of Continuous and Discrete Signals 63
subplot(2,2,1);
stem (n, real(fn)); hold on; plot(n,yzero);
title (‘real part of [f(n)] vs. n’)
ylabel(‘real part of [f(n)]’);
axis([0 15 -2 3])
subplot(2,2,2);
stem(n, imag(fn));
hold on;plot(n,yzero);
ylabel(‘imaginary part of [f(n)]’)
title(‘imaginary part of [f(n)] vs. n’)
ylabel(‘imaginary part of [f(n)]’);
axis([0 15 -2 2])
subplot(2,2,3);
stem(n, abs(fn));
title(‘magnitude of [f(n)] vs. n’)
xlabel(‘time index n’)
ylabel(‘magnitude of [f(n)]’)
subplot(2,2,4);
stem(n,(180/pi) * angle(fn));
hold on; plot(n,yzero);
title(‘phase of [f(n)] vs n’)
xlabel(‘time index n’)
ylabel(‘degrees’)
The script fi le disc_plots is executed and the results are shown in Figure 1.54.real part of [f(n)] versus n imaginary part of [f(n)] versus nreal part of [f(n)]
imaginary part of [f(n)]321− 1− 2
0 51015020− 1− 2
0 510151magnitude of [f(n)] versus n
3210
0 5 10 15magnitude of [f(n)]time index n time index ndegrees200100− 100− 20000 5 10 15phase of [f(n)] versus nFIGURE 1.54
Plots of Example 1.6.