Re: FFT and DFT
- From: Matthew Lybanon <lybanon@xxxxxxxxxxxxx>
- Date: Tue, 14 Mar 2006 15:20:49 GMT
in article 4415D32C.3B47ECE5@xxxxxxxxxxx, Mike Fontenot at
mlfasf@xxxxxxxxxxx wrote on 3/13/06 2:16 PM:
laguiche2004@xxxxxxxx wrote:The "Fast" Fourier transform is fast (faster than simply implementing the
I use the function cvDFT (OpenCV library) in Visual C++. But i don't
find the same Matlab 's result with the function fft2. Why?
for the vector [0 0 1], Matlab return [1, -0.5+0.866i, -0.5-0.866i],
and with the function cvDFT in OpenCV i have [1, 1, -0.5-0.86i] for the
same vector.
I haven't used either package, but the fft requires that the number
of samples be a power of 2, whereas the dft doesn't restrict the
number of samples. Your input has three samples, so you have to
use the dft, not the fft. It may be that the fft program accepts
your input, and pads a zero on the end to get four samples...but the
spectrum of the resulting signal is different than for just the
original three samples (because the dft and fft basically consider the
samples to be one period of a periodic stream).
Mike Fontenot
definition of the discrete FT) when the number of samples can be factored
(i.e., the number is not a prime). The details of the FFT algorithm exploit
the factored form of the number, and the greatest speed gain occurs when the
number is a power of 2. More or less, a power of two can be factored "the
most." Some implementations of the FFT may be limited to powers of 2, but
complete implementations of the algorithm do not.
As another poster points out, some implementations may cheat by "padding"
the end of the sample vector with enough 0s to make the augmented number of
samples a power of 2.
.
- Follow-Ups:
- Re: FFT and DFT
- From: stevenj
- Re: FFT and DFT
- References:
- FFT and DFT
- From: laguiche2004
- Re: FFT and DFT
- From: Mike Fontenot
- FFT and DFT
- Prev by Date: resistance propotionell to the square of the velecito
- Next by Date: Re: Quantum Gravity-Dark Energy as Zero-Infinity (Coded as 0-1) Duals 20: Unit Ball in Functional Analysis
- Previous by thread: Re: FFT and DFT
- Next by thread: Re: FFT and DFT
- Index(es):
Relevant Pages
|