[Thread Prev][Thread Next][Index]

[ferret_users] FFT: incorrect frequency axis



Dear Ferret users,

The functions ffta and fftp return the wrong frequency axis when the length of the data is an odd number.  The error is minor as long as the length of data is large. See below.

The source of the error comes from this statement:

"the frequency axis runs from freq1 = yquist/ float(nfreq) to freqn = yquist"

from "Ch3 Sec2.3.26. FFTA" of the official manual.

What's wrong with the statement?

The fundamental formula given in the manual

f(t) = S(j=1 to N/2)[a(j) cos(jwt + F(j))]
where w=2 pi/T

is correct. According to this formula, the angular frequencies are

w, 2w, 3w, . . . 

In terms of frequency,

(1/T),  2(1/T), 3(1/T), . . . 

[Note that angular frequency = 2 pi frequency.]  So, the FFT function should return this frequency axis.

On the other hand, yquist = 1/(2 Δt) and Δt = T/N.  When N is even, nfreq = N/2. So,

[ferret_users] FGD_GPL: no active window
  • Next by thread: [ferret_users] running ferret.jnl script in python
  • [Thread Prev][Thread Next][Index]