help-octave
[Top][All Lists]
Advanced

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

Re: Does your machine also FFT like mine?


From: Kai Mueller
Subject: Re: Does your machine also FFT like mine?
Date: Wed, 13 May 1998 20:57:47 +0200

On Mon, May 11, 1998 at 05:17:27PM +0200, Dirk Laurie wrote:
> Encouraged by the prompt responses to my plot question -- thanks
> everyone! -- let me rephrase the FFT one to which nobody replied.
> 
> On my Linux/586 machine, I get
> 
> > ifft(fft([1 1 0 0 1]))
> ans =
>     1.0000e+00    1.0000e+00   -1.4682e-08   -1.4682e-08    1.0000e+00
> 
> This is only single precision accurate.  Unfortunately the other
> machines I have access to have the same architecture and use the
> same binary and not surprisingly gives the same result.
> 
> What happens on your machine?
> 
> Dirk
> 

My reply is a little late but this happens on
DEC Alpha, OSF3.2c, gcc 2.7.2.3, DEC f90:

-----------------------------------------------------------------------
octave:3> ifft(fft([1 1 0 0 1]))
ans =

    1.0000e+00    1.0000e+00   -1.4682e-08   -1.4682e-08    1.0000e+00

-----------------------------------------------------------------------
Without patching the fortran sources I recompiled the FORTRAN
sources using the "-fpconstant" switch to 90, i.e. I entered

     gnumake FFLAGS="-O -fpconstant".

The man page says:

  -fpconstant
      Extend the precision of single precision constants assigned to
      double precision variables to double precision.

I have no idea why this is not the default but the result looks ok:

-----------------------------------------------------------------------
octave:3> ifft(fft([1 1 0 0 1]))
ans =

   1.0000e+00   1.0000e+00   7.3275e-16   7.3275e-16   1.0000e+00

-----------------------------------------------------------------------

-- 
 Kai P. Mueller
 Control Department (Regelungstechnik) | Phone [+49] (531) 391-3835
 Technical University Braunschweig     | Fax   [+49] (531) 391-5194
 D-38092 Braunschweig                  | Email address@hidden



reply via email to

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