Date: Dec 27, 2012 1:41 PM
Author: Wojtek
Subject: Re: Strange object position after IFFT2

I think I start to understand where is the problem. The whole thing concentrates in this simple piece of code which I prepared as an example:

clear all

a = [zeros(1,412) ones(1,200) zeros(1,412)];
adft = fftshift(fft(a)) ;

my_spectrum = zeros(1024,1024);
for k=1:1024
my_spectrum(k,k) = (adft(k)) ;
recon = (ifft2(ifftshift(my_spectrum))) ;
imagesc(abs(recon)) ;

I calculated 1D FFT of a square function. I placed in in the diagonal of my empty spectrum. The result (the reconstructed image "recon") should be (in my opinion) one square function going diagonally through the center. So why as a result I get two rectangular functions - not one?