|
Annea,
Sorry, this might be too late.
I just thought the root of the problem might be to do with the ordering of the output. Have a look at the fftshift and ifftshift commands to figure out whereabouts your DC component should be located.
Hope this helps
Tom Clark
"Annea Barkefors" <anba1944@student.uu.se> wrote in message <h7iqkh$3pr$1@fred.mathworks.com>...
> Hi!
>
> I'm trying to do a 3d fft on a 3d array of data, representing several images laying 'on top' of each other. Then I'm doing some stuff with the transformed data and transform it back with inverse fft. My problem is that when looking at the pictures I get out from my algoritm, they turn out up side down, and I'm having problem figuring out why. I'm using the command
>
> fftn(X),
>
> and have also tried with
>
> fft(fft(fft(X,[],1),[],2),[],3)
>
> and I find they give the same result. However, to check my result I calculated the zero frequency as
>
> sum(sum(sum(X)))
>
> and compared this with the zero frequency of my filtered data, and they don't match up. My array is made up of complex numbers, and when I try the fftn function on an array with real numbers, it works just fine. Also, if I take only one of my images, which means a 2d matrix with complex numbers, and transform that one using fft2 instead, then the zero frequency gets correct.
>
> Does anybody know what I'm doing wrong?
|