help-octave
[Top][All Lists]
Advanced

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

Re: fft: Octave vs. Matlab vs. IDL


From: Istvan Albert
Subject: Re: fft: Octave vs. Matlab vs. IDL
Date: Thu, 27 Sep 2001 18:23:10 -0500

Hi,

"E. Joshua Rigler" wrote:
 
> in MATLAB, Octave, and IDL.  All three give me different answers,
> although they do give a peak in power at 50, as expected.
> 
>   Matlab -> peak at 50 of ~  2e-11
>   Octave -> peak at 50 of ~ -8e-11 (yes that "-" is real)
>   IDL    -> peak at 50 of ~  2e-06 (PI here was single precision)


> Can somebody who knows more about FFTs than me suggest a reason why
> these would all return different values (and more importantly, how might
> I get them to return more similar answers)?  I might guess this has
> something to do with padding my vectors with zeros in a certain way, but
> that is only because I've heard people say this...I don't really
> understand what that means, or how it affects the FFT algorithm.

Padding does not affect the results, it is only needed to bring the number 
of values to be a power of two.

The reason you are getting different  values for your FFT transformations 
is that there is no consensus as to what is the  "power" in a power spectrum.
Some algorithm may compute it as a sum of the squared Fourier coefficients for 
a 
certain  frequency. Another one might normalize this sum  to the sum of all 
coefficients, and there are other ways to express the "power".

But for all projects you will only need the relative values. Values
that scale properly relative to each other. A peak 
that is twice as big than another should look so in any representation 
(and of course should appear at the same frequencies, but that works).

So don't worry about absolute values, unless you want to compare them 
to some other results, in wich case you should find out the method they used 

cheers,

Istvan.



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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