Path: news.mathworks.com!not-for-mail
From: "Andy Robb" <ajrobb@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Strange FFT Behavior in MATLAB
Date: Sat, 16 Aug 2008 03:40:20 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <g85i74$e3f$1@fred.mathworks.com>
References: <MPidnfQxFKtg_W_bnZ2dnUVZ_quhnZ2d@giganews.com> <1190307365.158064.56600@d55g2000hsg.googlegroups.com> <Xns99B186154B9B7scottseidmanmindspri@130.133.1.4> <fcuaer$bl9$1@fred.mathworks.com>
Reply-To: "Andy Robb" <ajrobb@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1218858020 14447 172.30.248.35 (16 Aug 2008 03:40:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 16 Aug 2008 03:40:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1374918
Xref: news.mathworks.com comp.soft-sys.matlab:485784



When analyzing (real) time series data, the complex
frequency spectrum is symmetric in the real part and
anti-symmetric in the imaginary part.

Way back in Matlab 3, when memory and performance were at a
premium, I formulated MEX files that used this symmetry to
reduce the data size.

It is possible to arrange a real time series into a complex
series of half the length and post process the fft output to
get the spectrum. Or the other way around - arranging half
the spectrum into a real series. For lengths of a power of
2, Matlab 3 used a fast Cooley Tukey algorithm which was
most efficient going from real to complex.

For even lengths that are not a power of 2, Matlab 3 only
used a complex FFT. In those cases, I took the real series
(either time series or half the spectrum), and arranged it
as a complex series of half the length. Again, I could take
half a frequency spectrum and rearrange it as a real series
then rearrange it again as a complex series of half the length.

It sounds more complicated than it was and it ran several
times faster.