[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A question on fftshift
From: |
Mark P. Esplin |
Subject: |
Re: A question on fftshift |
Date: |
Fri, 19 Jul 2002 10:48:02 -0400 |
User-agent: |
KMail/1.4.1 |
I would say that the fftshift doc needs to be changed. I use a Fourier
transforms spectrometer. If I put the input values that I use into your
formula I get the right spectral frequencies. If I use the formula in the
fftshift docs I don't.
-Mark Esplin
On Thursday 18 July 2002 12:46 pm, Steve M. Robbins wrote:
> Hi,
>
> 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
>
> http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookcpdf/c12-1.pdf
>
> 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
> frequencies
>
> f = linspace (-E/(4*Dt), (E/2-1)/(2*Dt), E)
>
>
> Who is correct?
>
> Thanks,
> -Steve
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------