Let's consider the cyclic frequency transform and let's try to make it so that the transform of the function is itself.
t=linspace(-32,32,4096);
dt=t(2)-t(1);
fq=linspace( -1/(2*dt) , 1/(2*dt) , length(t) + 1 );
fq=fq(1: length(t) );
x=exp(-pi*t.*t);
X=fftshift(fft(x)).*exp(-1i*2*pi*fq*t(1))*dt;
plot(t,real(X));hold on;plot(t,imag(X));hold off;
Now this actually works, and believe me it was not easy for me to get these right. I basically resorted to trial and error, tried adding $\pm 1$ everywhere until I got something that looked reasonable at all. I would like to learn the method behind this madness.
Is is a good idea to use something like
t=linspace(-32,32,4096);
Considering how the frequency is asymmetrical, perhaps time should be as well?What frequencies does the result of
X=fftshift(fft(x))
actually correspond to?Any other suggestions, etc.?