MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Mathematica 5 - Possible bug with Fourier

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42328] Mathematica 5 - Possible bug with Fourier
  • From: "Dana DeLouis" <delouis at bellsouth.net>
  • Date: Tue, 1 Jul 2003 08:45:36 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

With Mathematica 5, I believe the Function "Fourier" has a bug.  This did
not happen in version 4.2.  To make a long story short, it appears that
version 5 cannot take the Fourier if the list contains a negative full
precision number, and is mixed in with non full precision numbers.  However,
it works if the full precision number is positive.

My default settings are for Data Analysis (FourierParameters ->{-1,1})

For example, Fourier will not work on this simple list because the list has
a negative Sqrt[2].  It doesn't recognize -Sqrt[2] as a numeric quantity.

Fourier[
  {3.0000000563568115234`9.726174848649329,
   -4.9999999630004882812`10.130774008386414,
   -Sqrt[2]}]

 Fourier::"fftl":"Argument ...is not a non-empty list or rectangular array
of numeric quantities.

However, it will work if it is a Positive number ie Sqrt[2].

 Fourier[
  {3.0000000563568115234`9.726174848649329,
   -4.9999999630004882812`10.130774008386414,
   Sqrt[2]}]

It wont work here because of the negative -Sqrt[5].

 Fourier[
  {3.0000000563568115234`9.726174848649329,
   -4.9999999630004882812`10.130774008386414,
   -Sqrt[5]}]

The solution is to use the "old bug" solution of wrapping N around the list.
This now works, but Fourier is suppose to use N anyway?  Here's a short copy
from help on Fourier..."If the elements of list are exact numbers, Fourier
begins by applying N to them."

 Fourier[
  N[{3.0000000563568115234`9.726174848649329,
    -4.9999999630004882812`10.130774008386414,
    -Sqrt[5]}]]

{-1.412022628047822 + 0.*I, 2.206011342202317 -
   0.7978784379253223*I, 2.206011342202317 +
   0.7978784379253223*I}

It won't work on - Pi.
Fourier[
  {3.0000000563568115234`9.726174848649329,
   -4.9999999630004882812`10.130774008386414,
   -Pi}]

Fourier::"fftl":"Argument ...is not a non-empty list or rectangular array of
numeric quantities.

This bug shows up when generating a sine wave with random noise added.  The
data is usually less precise, but occasionally I get a -Sqrt[2] mixed in.
The new version 5 can't handle it.  Ahhh !@#

Dana
Window XP
Mathematica 5
Ng_only at hotmail.com



  • Prev by Date: ran2 from numerical recipes
  • Next by Date: Re: format Text in graphics
  • Previous by thread: Re: ran2 from numerical recipes
  • Next by thread: Re: High-speed sparse matrix operations with Mathematica 4.2 ???