Re: negative return values after FFT [message #49444] |
Thu, 27 July 2006 07:22  |
edward.s.meinel@aero.
Messages: 52 Registered: February 2005
|
Member |
|
|
FFT(*, *) can take REAL input and return a COMPLEX result; however, a
COMPLEX input always returns a COMPLEX result. To get a REAL result you
need to do:
inverse = REAL(ABS(FFT(ft, 1)))
Ed
PS. The one-line solution: inverse =
REAL(ABS(FFT(FILTERING_JOB(FFT(image, -1)), 1)))
adisn123@yahoo.com wrote:
> Hi,
>
> I did FFT from spacial domain to frequency domain on an image of about
> 500 x 500 pixel size.
>
> IDL> ft = FFT(image, -1)
>
> After filtering job, it was inversly fourier tranformed back using
> IDL> inverse = FFT(ft, 1)
>
> When I printed "inverse", the values were complex numbers.
>
> 1. Aren't they supposed to real numbers since I tranformed back to
> spcial domain?
>
> When I only get real numbers, using
> IDL> print, float(FFT(ft,1))
> There were some negative values in the array (quite a lot).
>
> For my understanding, the inversely fourier tranformed values should
> represent the pixel values corresponding to individual pixel
> coordinates in 500 x 500 size.
> How do I interpret those negative pixel values?
>
> Thanks.
|
|
|
Re: negative return values after FFT [message #49450 is a reply to message #49444] |
Wed, 26 July 2006 18:21   |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
adisn123@yahoo.com wrote:
> Hi,
>
> I did FFT from spacial domain to frequency domain on an image of about
> 500 x 500 pixel size.
>
> IDL> ft = FFT(image, -1)
>
> After filtering job, it was inversly fourier tranformed back using
> IDL> inverse = FFT(ft, 1)
>
> When I printed "inverse", the values were complex numbers.
>
> 1. Aren't they supposed to real numbers since I tranformed back to
> spcial domain?
That depends upon your filter. If h(x) is a real-valued function, and
H(f) is the corresponding fourier transform, then H(f) has the property
that H(-f) = (H(f))*, where '*' indicates complex conjugation.. If
that is still true after you apply your filter, then the filtered
fourier transform should invert to a real-valued function, too. This
means that your filter function must obey that same identity. Assuming
that your filter is itself real-valued, that means that F(-f) = F(f).
Is that true for your filter?
Keep in mind that the discrete fourier transform is stored with the
positive frequency components in the first half of the array, and the
negative frequency components in the second half. Thus, the requirement
that F(-f) = F(f) corresponds, in terms of array components, to the
requirement that F[i] = F[N-i-1].
|
|
|
Re: negative return values after FFT [message #49541 is a reply to message #49444] |
Thu, 27 July 2006 09:43  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
edward.s.meinel@aero.org wrote:
> FFT(*, *) can take REAL input and return a COMPLEX result; however, a
> COMPLEX input always returns a COMPLEX result. To get a REAL result you
> need to do:
>
> inverse = REAL(ABS(FFT(ft, 1)))
>
> Ed
>
> PS. The one-line solution: inverse =
> REAL(ABS(FFT(FILTERING_JOB(FFT(image, -1)), 1)))
OK - that's a different way of interpreting the message. I was
assuming, when he said that result was complex, that he wasn't
referring to the data type of the result, but to it's value: in other
words, that he was saying that the imaginary parts of the resulting
array had significantly non-zero magnitudes. With real-valued images,
and a properly defined filter, that shouldn't happen.
To the original poster (Google shortens your e-mail address to
'adisn...@yahoo.com', so I have no idea what I should call you):
Are you merely saying that the data type of the result was complex, or
are you making the stronger statement that the values in that result
had signficantly non-zero imaginary components?
|
|
|