Re: What are the errors in the FFT? [message #52441] |
Thu, 08 February 2007 10:24  |
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  |
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  |
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  |
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  |
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?
|
|
|