[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reverse FFT ?





"Richard Tyc" <richt@sbrc.umanitoba.ca> writes:

> Can you do a reverse FFT in IDL and how is it implemented  ?
> ie. FFT provides a complex array - How do you get the original Time domain
> back from the complex series.
> 
> I am trying to retrieve "k" space data back from real/imaginary MRI data.  I
> would like to see how time consuming this really is.

The direction of the FFT is controlled by the sign of the second
argument to the FFT() function call.

You can verify that you have recovered the original signal by the
following example:

yt1 = randomn(seed,256)  ;; Original signal
yf  = fft(yt1, +1)       ;; Transformed signal
yt2 = fft(yf,  -1)       ;; Transformed-transformed signal

Formally, the values of YT1 (the original signal) and YT2 (the
transformed-untransformed signal) should be identical.  Let's check
that:

plot, abs(yt1-yt2)

The residuals are very close to zero.  Two things are noteworthy.
First, YT2 is always going to be COMPLEX rather than float.  This is
because the FFT is by definition a complex algorithm.  Still, the
recovered signal should be *primarily* real.

Which gets to the second point.  You won't ever fully recover the
original signal since there is some round-off error.  That's why the
residuals are non-zero (and even complex).  I believe that Liam Gumley
has a web page on the numerical accuracy of FFT's.

Craig

-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------