% illustrates the effect of upsampling on the Fourier transform.

clear, figure(1),clf,

N = 1024;
om = (-N:N)*pi/N;

x = [1 3 2 1 3 8];
h = x;

H = DTFTfast(h,N);
figure(1),subplot(2,2,1);plot(om,abs(H)),
title('|Xs(omega)|=|FFT(x(k))|');xlabel('omega')
axis([-pi,pi,0,18])

disp('Plot of the Fourier transform of the signal')
disp('... push an arbitrary key to continue'),pause
%print -deps subsam2_1.eps

x = [1 0 3 0 2 0 1 0 3 0 8];
h = x;

H = DTFTfast(h,N);
figure(1),subplot(2,2,2);plot(om,abs(H))
title('|X(omega)|=|FFT(..x(k) 0..)|');xlabel('omega')
axis([-pi,pi,0,18])
disp('Plot of the Fourier transform, insert 1 zero')
disp('... push an arbitrary key to continue'),pause
%print -deps subsam2_2.eps

x = [1 0 0 3 0 0 2 0 0 1 0 0 3 0 0 8];    
h = x;

H = DTFTfast(h,N);
figure(1),subplot(2,2,3);plot(om,abs(H))
title('|X(omega)|=|FFT(..x(k) 0 0..)|');xlabel('omega')
axis([-pi,pi,0,18])
disp('Plot of the Fourier transform, insert 2 zeros')
disp('... push an arbitrary key to continue'),pause
%print -deps subsam2_3.eps

x = [1 0 0 0 3 0 0 0 2 0 0 0 1 0 0 0 3 0 0 0 8];
h = x;

H = DTFTfast(h,N);
figure(1),subplot(2,2,4);plot(om,abs(H))
title('|X(omega)|=|FFT(..x(k) 0 0 0..)|');xlabel('omega')
axis([-pi,pi,0,18])
%print -deps subsam2_4.eps
disp('Plot of the Fourier transform, insert 3 zeros');

