Path: news.mathworks.com!not-for-mail
From: "David " <dave@bigcompany.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fft sign?
Date: Tue, 29 Apr 2008 16:30:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <fv7ieb$am2$1@fred.mathworks.com>
References: <fv7gge$a1d$1@fred.mathworks.com>
Reply-To: "David " <dave@bigcompany.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 1209486603 10946 172.30.248.35 (29 Apr 2008 16:30:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 Apr 2008 16:30:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 791003
Xref: news.mathworks.com comp.soft-sys.matlab:465765


"h xu" <quabla123@gmx.de> wrote in message 
<fv7gge$a1d$1@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=-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=-5;
> xmax = 5;
> 
> N= 2^8;
> dx = (xmax-xmin)/N;
> x = linspace(xmin,xmax,N);
> 
> y= exp(3* i*pi/xmax *x);
> NFFT = 2^nextpow2(N);
> Y_ = fft(y,NFFT)*dx;
> q = [0:NFFT-1]/NFFT/dx*xmax*2;
> Y = Y_(1:NFFT)/dx/NFFT;
> plot(q,real(Y),'.b') 
> 
> 

try
y= -1*exp(3* i*(pi/xmax) *x);