[Top][All Lists]

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

A question on fftshift

From: Steve M. Robbins
Subject: A question on fftshift
Date: Thu, 18 Jul 2002 11:46:51 -0500
User-agent: Mutt/1.4i


I hope someone can tell me if the bug lies in the fftshift doc or
my comprehension.

My understanding of the discrete Fourier transform, confirmed by
Numerical Recipes

is that the frequency interval for the FFT output is [-fc,fc] where fc
is the critical (Nyquist) frequency.

For samples spaced Dt apart, fc = 1/(2*Dt), so I expect the output
range to be [-1/(2*Dt),1/(2*Dt)].  Or, rather, the standard "wrapped"
sequence of this.  Thus, I would expect that after "fftshift", the
frequency values for the sample points should be

  linspace( -1/(2*Dt), 1/(2*Dt) - 1/(N*Dt), N )

for an input of N samples.

The documentation for fftshift says otherwise, however.

 - Function File:  fftshift (V)
     Perform a shift of the vector V, for use with the `fft' and `ifft'
     functions, in order the move the frequency 0 to the center of the
     vector or matrix.

     If V is a vector of E elements corresponding to E time samples
     spaced of Dt each, then `fftshift (fft (V))' corresponds to

          f = linspace (-E/(4*Dt), (E/2-1)/(2*Dt), E)

Who is correct?


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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