🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.math.num-analysis
Article #641

bug in FFT Numerical Recipes in C?

#641
From: Bruce Sutherland
Date: Fri, 16 Oct 1992 01:29
16 lines
1334 bytes
I'm hoping there are some people who have encountered a similar problem
to mine using the `Numerical Recipes in C' Fast Fourier Transform routine, four1.

In taking the fourier transform of the real function f(z)=z I get the
correct imaginary part of the fourier coefficients.  However, the real part,
which should be zero, evaluates to the same constant,C, for all non-zero
modes and zero for the zero mode.  If the domain size is L, this constant 
is L/(n-1) where n is the number of fourier modes.  It is as if the fft 
creates the shadow of a downwards shifted delta function, C (delta(x) -1).

I get the same results using both the realft and four1 routines.  What I want
to know is whether this result (C non-zero) is an artifact of the program
and if there is any way to eliminate it in a satisfactory manner?  

Thanks in advance,
Bruce Sutherland (brucer@helios.physics.utoronto.ca)
Technical Details
Message-ID: <Bw6xH0.ILs@helios.physics.utoronto.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!helios.physics.utoronto.ca!brucer

Show Full Headers
Complete Article Headers
Newsgroups: sci.math.num-analysis
Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!helios.physics.utoronto.ca!brucer
From: brucer@helios.physics.utoronto.ca (Bruce Sutherland)
Subject: bug in FFT Numerical Recipes in C?
Message-ID: <Bw6xH0.ILs@helios.physics.utoronto.ca>
Sender: news@helios.physics.utoronto.ca (News Administrator)
Organization: University of Toronto Physics/Astronomy/CITA
Date: Fri, 16 Oct 1992 01:29:24 GMT
Lines: 16