Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!8g2000hse.googlegroups.com!not-for-mail
From: "Steven G. Johnson" <stevenj@alum.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Does Matlab do FFT correctly ?
Date: Fri, 2 May 2008 21:06:31 -0700 (PDT)
Organization: http://groups.google.com
Lines: 29
Message-ID: <da5827de-b6d8-4f66-9943-86aa762b2175@8g2000hse.googlegroups.com>
References: <fvfs3j$bnf$1@fred.mathworks.com> <fvg2pb$73p$1@fred.mathworks.com> 
NNTP-Posting-Host: 65.96.165.69
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1209787591 18098 127.0.0.1 (3 May 2008 04:06:31 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 3 May 2008 04:06:31 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 8g2000hse.googlegroups.com; posting-host=65.96.165.69; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; 
	rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:466384


On May 2, 6:15 pm, "Chen Sagiv" <chensagiv...@gmail.com> wrote:
> Thanks for your friendly answer.
> I am wondering what are the implications of your input on
> real life signals and images.
>
> I am looking at the Fourier phase of signals and images.
> Now, when I calculate the fft of say, an images, will I get
> the correct phase, or do I have to do some tricks ?

Your question is ill-defined, because it depends on what you mean by
"correct".  From a certain point of view, the "correct" thing is what
Matlab does.

I think you mean, "will I get the phase corresponding to the origin at
the center of the image" and the answer is no, of course: you will get
the phase corresponding to the origin at the corner, corresponding to
the DFT definition, unless you use ifftshift first.

In real life, in any real application, it is easy to deal consistently
with the origin corresponding to the DFT definition, and you are never
in practice forced to use ifftshift (unless you want to).  But, as
with all thing in numerical calculation, whenever you use a black box
like fft(...), you don't need to know *how* it computes what it does
but you had better understaht *what* it is computing.  To do any kind
of discrete signal processing with FFTs, you have to understand the
DFT and how it differs from the continuous Fourier transform.

Regards,
Steven G. Johnson