Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!b9g2000prh.googlegroups.com!not-for-mail
From: NZTideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fft sign?
Date: Tue, 29 Apr 2008 17:55:11 -0700 (PDT)
Organization: http://groups.google.com
Lines: 43
Message-ID: <a7ad61d1-99a9-45dc-a09d-71a80e177a2b@b9g2000prh.googlegroups.com>
References: <fv7gge$a1d$1@fred.mathworks.com> <fv7ieb$am2$1@fred.mathworks.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1209516912 891 127.0.0.1 (30 Apr 2008 00:55:12 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 30 Apr 2008 00:55:12 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: b9g2000prh.googlegroups.com; posting-host=202.78.152.105; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon; 
Xref: news.mathworks.com comp.soft-sys.matlab:465832



On Apr 30, 4:30=A0am, "David " <d...@bigcompany.com> wrote:
> "h xu" <quabla...@gmx.de> wrote in message
>
> <fv7gge$a1...@fred.mathworks.com>...
>
>
>
>
>
> > i've written a small and simple script to test the
> > fft-function of matlab that transformates exp
> (i*n*pi/xmax *
> > x) from xmin=3D-xmax to xmax. that should result in a
> > kronecker delta with positive amplitude with value 1...
> but
> > for some reason the amplitude is negative for odd n,...
> why
> > is that?
>
> > xmin=3D-5;
> > xmax =3D 5;
>
> > N=3D 2^8;
> > dx =3D (xmax-xmin)/N;
> > x =3D linspace(xmin,xmax,N);
>
> > y=3D exp(3* i*pi/xmax *x);
> > NFFT =3D 2^nextpow2(N);
> > Y_ =3D fft(y,NFFT)*dx;
> > q =3D [0:NFFT-1]/NFFT/dx*xmax*2;
> > Y =3D Y_(1:NFFT)/dx/NFFT;
> > plot(q,real(Y),'.b')
>
> try
> y=3D -1*exp(3* i*(pi/xmax) *x);- Hide quoted text -
>
> - Show quoted text -

Try:
plot(q,abs(Y),'.b')
The sign of the real component (assuming the imaginary component is
zero) is just telling you the phase.
phase=3Dangle(Y)*180/pi;