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

Home » Public Forums » archive » FFT with NANs in an array
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: FFT with NANs in an array [message #49441 is a reply to message #49342] Thu, 20 July 2006 12:24 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <1153418459.663699.178520@i42g2000cwa.googlegroups.com>,
adisn123@yahoo.com wrote:

> Hi,
>
> I'm trying to fourier transform a spacial domain image to frequency
> domain using FFT function in IDL.
>
> My image has quite a bit of NANs in an array, about 5%.
>
> When I use FFT into the image, it doesn't give me any errors, but when
> I inversely fourier transform after
>
> filtering, it gives a little funky result.
>
> How do I make FFT ignore NANs in their job or filtering?

FFTs assume no missing data. Missing data destroys the symmetry that
makes the "Fast" part of FFT work.

You haven't indicated your purpose, but basically, your options are:

1) Interpolate to fill the gaps before FFTing. If your gaps are
irregular, this can be tedious; and you should do some tests with known
data to evaluate the effects of the interpolation. For example, take a
complete image with properties similar to your data and delete 5% of the
data. Interpolate the gaps and then compare the FFTs of the original
and interpolated images.

2) Use a curve-fitting routine, such as REGRESS, to fit sines and
cosines. (Least-squares fitting with sines and cosines is equivalent to
the FFT when there is no missing data.) This is much slower than an
FFT, but if your data size is not too large, you may not notice or care.
If you know ahead of time that you only want to keep a few frequencies,
then this could be as fast as an FFT.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrPolygon with different colors for shading and lines
Next Topic: Re: IDL_IDLBridge in Virtual Machine

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

Current Time: Fri Oct 10 17:46:16 PDT 2025

Total time taken to generate the page: 1.20398 seconds