% Part (h)

plot(omega,abs(x));
hold on;

t = [0:0.125:7.825];
xfft = exp(-t).*cos(4*t) - 0.125*exp(-t).*sin(4*t);
Xfft = fft(xfft, 2048);
k = [0:2047];
wk = -pi*8 + 2*pi*k/256;
plot(wk,0.11*abs(fftshift(Xfft)),'r');
title('|X(j\omega)| (from fft)');
xlabel('\omega');
print X_freq_fft.eps -depsc

hold off;

% The plots are not precisely the same, because the result of fft
% is a periodic function on [0,2pi], whereas the true plot is
% not periodic; thus there is distortion about the edges of the plot.
