% dtft_disp.m
% Script that runs and displays results of DTFT operation
%
% n = vector of n values used for calculation
% x = vector of time function, same size as x
% w = vector of omega values, not normalized
% ndisp = vector of n values used for display, a subset of n
% X = DTFT values computed at w frequencies


[X] = dtft(x,n,w);

ndisplen = length(ndisp);
ndispbeg = ndisp(1)-n(1)+1;
ndispend = ndispbeg+ndisplen-1;
subplot(3,1,1),stem(ndisp,x(ndispbeg:ndispend))
xlabel('n')
ylabel('x[n]')
alphadisp = num2str(alpha);
title(['x[n] = ',alphadisp,'^n u[n]'],'fontsize',14)
subplot(3,1,2),plot(w/pi,abs(X))
xlabel('omega/pi')
ylabel('|X|')
subplot(3,1,3),plot(w/pi,angle(X)/pi)
xlabel('omega/pi')
ylabel('<X/pi')
