Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Purely real result of IFFT
Date: Thu, 4 Oct 2007 17:54:17 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 52
Message-ID: <fe39c9$1p3$1@fred.mathworks.com>
References: <fe346p$8no$1@fred.mathworks.com> <fe36l0$i5h$1@fred.mathworks.com> <fe385v$coq$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1191520457 1827 172.30.248.38 (4 Oct 2007 17:54:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 4 Oct 2007 17:54:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:431385



I looked at that... it still seems to give a very weird result.

If i take a=[1 2 3 4 5 6]

b=fft(a) is in the strange form (not symmetric over the 3/4
break)

fftshift(b) is actually just as not symmetric, simply the 2
halves switched.

Any more ideas?

David

"David " <dave@bigcompany.com> wrote in message
<fe385v$coq$1@fred.mathworks.com>...
> "David Doria" <daviddoria@gmail.com> wrote in message 
> <fe36l0$i5h$1@fred.mathworks.com>...
> > Ok that tells me that I came to the correct conclusion, 
> but
> > here is a bit further question
> > 
> > I thought the sum in the IDFT was from  k = -N/2 to N/2, 
> but
> > here it is from k=0 to N-1
> > 
> > if you assume that Xk is a complex number (a+bi), and use
> > Eulers formula to get cos(2*pi*j*k*n/N) + i*sin
> (2*pi*j*k*n/N)
> > 
> > you can show that if X(k) = X(-k)* then all the imaginary
> > terms cancel.  This doesn't work if there are never 
> negative
> > numbers in the exponent.  How could you show this 
> property
> > using k = 0 to N-1 ??
> 
> i am probably not the best one to explain this, but take a 
> good look at the fftshift function and the indexing they 
> explain in the description of the fft function itself in 
> the help.  i rarely have use for ifft and usually only 
> worry about psd... but i think what you would expect to be 
> the -N/2 to 0 part is actually the high end of the vector, 
> the fftshift function moves it around so the '0' index (DC 
> component) is in the middle of the result vector, which is 
> easier for some people to handle... then you just have to 
> subtract N/2 from each index to line up the indexing with 
> the classical formulas.  again, this is all because matlab 
> indexes have to be integers >0... so everything is shifted 
> to accomodate this limitation.
>