Numerical Recipes: Error in Chapter 12?

Steven Lin splin at mowlavi.berkeley.edu
Sun Mar 3 06:34:48 AEST 1991


     Is the definition of the Fourier transform, (12.0.1), (12.0.3), (12.1.7),
and elsewhere throughout the entire chapter incorrect?  Specifically, the
exponential terms in (12.0.1) should be switched.  
     I discovered this error while trying out their fft routine, four1  on
page 411.  The routine implements (12.1.7) correctly, but (12.1.7) is not
the correct or, at least, standard definition of the DFT.  You can get four1
to implement the DFT correctly by changing one line from
  
       theta=6.28318530717959/(isign*mmax);

to

       theta=-6.28318530717959/(isign*mmax);
       
This change must also be done to the other FFT routines within that chapter.
I discovered these errors in a 1990 reprint.

If I am incorrect, please tell me.  Redirection to the proper newsgroup would
also be appreciated.



More information about the Comp.lang.c mailing list