Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!d55g2000hsg.googlegroups.com!not-for-mail
From:  robert bristow-johnson <rbj@audioimagination.com>
Newsgroups: comp.dsp,comp.soft-sys.matlab
Subject: Re: Strange FFT Behavior in MATLAB
Date: Thu, 20 Sep 2007 16:56:05 -0000
Organization: http://groups.google.com
Lines: 41
Message-ID: <1190307365.158064.56600@d55g2000hsg.googlegroups.com>
References: <MPidnfQxFKtg_W_bnZ2dnUVZ_quhnZ2d@giganews.com>
NNTP-Posting-Host: 207.190.198.130
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1190307365 31498 127.0.0.1 (20 Sep 2007 16:56:05 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 20 Sep 2007 16:56:05 +0000 (UTC)
In-Reply-To: <MPidnfQxFKtg_W_bnZ2dnUVZ_quhnZ2d@giganews.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060913 Fedora/1.5.0.7-1.fc5 Firefox/1.5.0.7 pango-text,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: d55g2000hsg.googlegroups.com; posting-host=207.190.198.130;
Xref: news.mathworks.com comp.dsp:229285 comp.soft-sys.matlab:429464



On Sep 20, 8:01 am, "patrickjennings" <patrick.t.jenni...@gmail.com>
wrote:
> I think we can all agree that FFT { x*(n) } = X*(N-k),

actually the folks at The Math Works do not agree.  as fatnbafan said,
MATLAB is hard-wired or hard-coded so that the indices of all arrays
begin with 1, not 0 as it should for the DFT or FFT.

so in MATLAB, if N=length(x); y = conj(x);  X = fft(x);  Y = =
fft(y);  then

   Y(k+1) = conj( X(mod(N-k+1, N)) );         % for  0 <= k < N

or stated so elegantly that it's amazing we all don't just sing the
praises of MATLAB,

   Y(k) = conj( X(mod(N-k+2, N) );            % for  1 <= k <= N

gee, isn't that elegant?

r b-j

> or the FFT of the
> conj of x(n) is the conj of the reversed version of the FFT of x(n).
>
> But in MATLAB if a= [1+2j 3+4j 5+6j 7+8j] then
>
> fft(conj(a))          = [16+20j    -8+0j    -4-4j    0-8j]
>
> and
>
> conj(fliplr(fft(a))) = [-8+0j      -4-4j    0-8j   16+20j]
>
> Any ideas?  Another engineer and I spent most of a day looking at the
> model before finding the fundamental problem.
>
> Cheers
>
> /Patrick