M3.8 . I used the following script to generate the plots below,
which show that the DFT can be evaluated by samplign the DTFT:
% M3.8
% Adam Berenzweig
% pulse length
M = 21;
halfM = (M-1)/2;
% overall sequence length (padded)
N=1001;
k = 0:N-1;
w = 2*pi*k/N;
% rectangular pulse
%xn = [zeros(1,(N-M)/2) ones(1,M) zeros(1,(N-M)/2)];
% triangular pulse
n=-(M-1)/2:(M-1)/2;
xn = [zeros(1,(N-M)/2) 1-abs(n)/((M-1)/2) zeros(1,(N-M)/2)];
% by FFT
length(xn)
wn1 = fft(xn);
% by evaluation of DTFT
%wn2 = sin(M/2*w)./sin(w/2); % for rect
wn2 = (sin(halfM/2*w)./(halfM*sin(w/2))).^2; % for triangle
subplot 211
plot(w/pi,abs(wn1))
%title(['rectangular pulse, N=' num2str(halfM)]);
title(['triangular pulse, N=' num2str(halfM)]);
xlabel('via fft')
subplot 212
plot(w/pi,abs(wn2))
xlabel('via evaluated DTFT')