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

Home » Public Forums » archive » Re: What are the errors in the FFT?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: What are the errors in the FFT? [message #52441] Thu, 08 February 2007 10:24 Go to next message
Kenneth Bowman is currently offline  Kenneth Bowman
Messages: 86
Registered: November 2006
Member
In article <1170953635.505681.59040@v33g2000cwv.googlegroups.com>,
monty@lanl.gov wrote:

> For a given function f(t) I am finding:
>
> FFT(FFT(f(t),-1),1) -f(t) varies between about 10^-7 to 1-^-8 for
> floating point
> and about 10^-14 to 10^-16 for double precision
>
> (I.e. the inverse transform of the transform deviates from the
> original function)
>
> Is this aproblem with the IDL implementation of the FFT, or is this a
> more fundamental issue with the algorithm itself?
>
> -Monty Wood

That is simply roundoff error. Unavoidable with floating-point
calculations, I'm afraid.

Ken Bowman
Re: What are the errors in the FFT? [message #52456 is a reply to message #52441] Thu, 08 February 2007 10:45 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Haje Korth wrote:
> Monty,
> Congratulations, you have just discovered you machine's precisions in doing
> floating point mathematics. :-)

ha ha. but wouldn't

IDL> help, machar(),machar(/double),/struct

have been much faster? :o) Not as much fun, though.

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Re: What are the errors in the FFT? [message #52457 is a reply to message #52441] Thu, 08 February 2007 10:43 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
monty@lanl.gov wrote:
> For a given function f(t) I am finding:
>
> FFT(FFT(f(t),-1),1) -f(t) varies between about 10^-7 to 1-^-8 for
> floating point
> and about 10^-14 to 10^-16 for double precision

What are the magnitudes of the original f(t)? If close to one, sounds like "simple"
accumulation of precision errors.

> (I.e. the inverse transform of the transform deviates from the
> original function)

Depends on your definition of "deviates".

> Is this aproblem with the IDL implementation of the FFT, or is this a
> more fundamental issue with the algorithm itself?

Depending on your input function magnitudes, it's more likely a (the? :o) fundamental
issue with floating point arithmetic. There are ways of minimising this sort of error
accumulation (and I assume FFT algorithms do it already), but you can't remove it entirely.

cheers,

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
Re: What are the errors in the FFT? [message #52458 is a reply to message #52441] Thu, 08 February 2007 10:37 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Monty,
Congratulations, you have just discovered you machine's precisions in doing
floating point mathematics. :-)

BTW: I have uploaded an FFTW3 implementation to the ITTVIS codebank. Should
be ready for grabs there in a few days. You can double check just for grins.

Cheers,
Haje



<monty@lanl.gov> wrote in message
news:1170953635.505681.59040@v33g2000cwv.googlegroups.com...
> For a given function f(t) I am finding:
>
> FFT(FFT(f(t),-1),1) -f(t) varies between about 10^-7 to 1-^-8 for
> floating point
> and about 10^-14 to 10^-16 for double precision
>
> (I.e. the inverse transform of the transform deviates from the
> original function)
>
> Is this aproblem with the IDL implementation of the FFT, or is this a
> more fundamental issue with the algorithm itself?
>
> -Monty Wood
>
Re: What are the errors in the FFT? [message #52463 is a reply to message #52441] Thu, 08 February 2007 09:38 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Feb 8, 10:53 am, m...@lanl.gov wrote:
> For a given function f(t) I am finding:
>
> FFT(FFT(f(t),-1),1) -f(t) varies between about 10^-7 to 1-^-8 for
> floating point
> and about 10^-14 to 10^-16 for double precision
>
> (I.e. the inverse transform of the transform deviates from the
> original function)
>
> Is this aproblem with the IDL implementation of the FFT, or is this a
> more fundamental issue with the algorithm itself?
>
> -Monty Wood

Wow, one part in 10-100 million?? Why do you care?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Arrays of Structures
Next Topic: Re: READS as a speed improvement or simply style?

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

Current Time: Wed Oct 08 15:52:13 PDT 2025

Total time taken to generate the page: 0.00577 seconds