help-octave
[Top][All Lists]
Advanced

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

RE: Problems with FFT and IFFT


From: Frank Palazzolo
Subject: RE: Problems with FFT and IFFT
Date: Tue, 28 Feb 2006 15:50:16 -0500

Hi,

I noticed that the fftw library has specializations for FFT's on purely real
data.  They claim that they run about 2x faster and have half the memory
requirements - since you only need to store "one side".  As a bonus that
mode eliminates this particular problem by design.

It might be interesting to wrap these special FFT's in octave
(fft_real/ifft_real?) and see how the work.  I bet most people are
processing real datasets with fft(), and almost always need to do
real(ifft()).

-Frank

-----Original Message-----
From: Steve C. Thompson [mailto:address@hidden 
Sent: Tuesday, February 28, 2006 2:56 PM
To: John W. Eaton
Cc: Octave Help
Subject: Re: Problems with FFT and IFFT


On 28 Feb 06 14:27PM, John W. Eaton wrote:
> On 28-Feb-2006, Sascha Berkenkamp wrote:
> 
> | Must I set all values smaller than eps to zeros?
> 
> You can do that if you think it is appropriate for your application.

I've had experience with this precision issue too.  Here's an
example:

  A1 = rand (1, 5) + j * rand (1, 5);
  A = [0, A1, conj(fliplr (A1))];
  a = ifft (A);
  isreal (a)

  A1 = rand (1, 50) + j * rand (1, 50);
  A = [0, A1, conj(fliplr (A1))];
  a = ifft (A);
  isreal (a)

The output of the IFFT should be real-valued since the input vector is
complex-conjugate symmetric.  On my system [uname -a: Linux ...
2.6.12-10-386 ...  i686 GNU/Linux; octave --version: GNU Octave, version
2.1.71 (i486-pc-linux-gnu)], I get:

  octave:1> A1 = rand (1, 5) + j * rand (1, 5);
  octave:2> A = [0, A1, conj(fliplr (A1))];
  octave:3> a = ifft (A);
  octave:4> isreal (a)
  ans = 1

  octave:5>
  octave:5> A1 = rand (1, 50) + j * rand (1, 50);
  octave:6> A = [0, A1, conj(fliplr (A1))];
  octave:7> a = ifft (A);
  octave:8> isreal (a)
  ans = 0

So for the longer vector, the precision issue creeps in.  In this particular
case, I just follow the IFFT with a `real ()'.

Steve



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]