Re: negative return values after FFT [message #49538 is a reply to message #49458] |
Fri, 28 July 2006 05:15   |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
adisn123@yahoo.com wrote:
> The returned (inversely fourier transformed) values are in a complex
> number format, but
> I realized that those imaginary parts are very small, almost close to
> zero with ~10^-8 floating
> point.
OK, that's a normal consequence of the fact that all floating point
mathematics have a certain inherent inaccuracy. Values that
mathematically should be exactly 0 come out numerically as "almost" 0;
it's unfortunately unavoidable. In that case extracting the real
component and ignoring the imaginary components is the appropriate
solution.
...
> I have another question related to the returned values.
>
> How do I interpret the "negative" spacial pixel values after inverse
> FFT?
If your unfiltered image frequently goes close to zero, filtiering it
is likely to cause it to sometimes go negative. That's because each
component in the frequency domain represents a function in the spatial
domain that oscilates between positive and negative values. No matter
how you change the value of a frequency component, either by increasing
it or by decreasing it, you'll be increasing the image in some
locations, and decreasing it somewhere else. If you're unlucky enough,
the places where it decreases the image brightness might be places
where the brightness is already so low that the changes made by the
filter make it go negative.
If you're sure your filter implements what you want it to implement,
I'd recommend treating the negative pixels as zeros. However, if you
ever decide to rebin the data to a lower resolution, use the original
values, including the negatives - don't replace the negative values
with zeros until after re-binning, because otherwise you'll be creating
a systematic bias, making the darkest parts of your image slightly
brighter than they should be.
|
|
|