comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » negative return values after FFT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: negative return values after FFT [message #49538 is a reply to message #49458] Fri, 28 July 2006 05:15 Go to previous messageGo to previous message
James Kuyper is currently offline  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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: kernel convolution?
Next Topic: doubt in IDL Smooth in 2D with NaN values and /edge

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 15:35:32 PDT 2025

Total time taken to generate the page: 0.32005 seconds