Frequency spectrum with fft of a real valued array...?
robert.kern at gmail.com
Thu Jan 11 19:08:00 CET 2007
> What does it mean to me? How do I get to the wanted frequenca spectrum???
It's packed in the conventional FFT format. Here is a function in numpy (the
successor to Numeric, which I assume that you are using) that generates the
corresponding frequencies in the same packed format:
In : import numpy
In : numpy.fft.fftfreq?
Base Class: <type 'function'>
Definition: numpy.fft.fftfreq(n, d=1.0)
fftfreq(n, d=1.0) -> f
DFT sample frequencies
The returned float array contains the frequency bins in
cycles/unit (with zero at the start) given a window length n and a
sample spacing d:
f = [0,1,...,n/2-1,-n/2,...,-1]/(d*n) if n is even
f = [0,1,...,(n-1)/2,-(n-1)/2,...,-1]/(d*n) if n is odd
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-list