angfreq = 2*pi*0.01; N = 256; n = 0:N-1; %n = (-N/2):(N/2-1); % fail to reproduce the translation property if I use this phi = 1; a = 1; w = 2*pi/N*n;
f = cos(angfreq*n); e = exp(-i*w*a); sf = real(ifft(ifftshift(fftshift(fft(f)).*e))); plot(n, f); hold on; plot(n, sf,'r');
The plot shows a perfect translation by 1 unit with the operator exp(-i*w*a). There, the fourier frequency is defined as w = 2*pi/N*n; However, in fft should the frequency defines as w = 2*pi/M*[0:N/2, -N/2+1:-1] such that the zero order goes first, positive frequency follows and then the negative frequencies. However, if I defined it this way by making the n = (-N/2):(N/2-1); I fail to see the correct translation. Why is that?