% Shift_Tempi_DFT
clear
close all
N=21
r=0.5;
x=gausswin(N,5);
figure(1)
stem((0:N-1),x,'filled')
title('x: segnale nei tempi')
pause
X=fft(x);
figure(2)
stem((0:N-1),abs(X),"filled")
title('X: DFT del segnale')
pause
figure(3)
subplot(211)
if(round(N/2)==N/2)
   k=(-N/2:N/2-1);
else
   k=(-(N-1)/2:(N-1)/2);
end
v=transpose(exp(-j*2*pi*k*r/N));
stem(k,angle(v),"filled")
vs=ifftshift(v);
pause
subplot(212)
stem((0:N-1),angle(vs),"filled")
pause
figure(4)
Y=X.*vs;
y=ifft(Y);
stem((0:N-1),real(y),'r','filled')
title("segnale traslato")
