Path: news.mathworks.com!not-for-mail
From: "h xu" <quabla123@gmx.de>
Newsgroups: comp.soft-sys.matlab
Subject: fft sign?
Date: Tue, 29 Apr 2008 15:57:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <fv7gge$a1d$1@fred.mathworks.com>
Reply-To: "h xu" <quabla123@gmx.de>
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 1209484622 10285 172.30.248.35 (29 Apr 2008 15:57:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 Apr 2008 15:57:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1370985
Xref: news.mathworks.com comp.soft-sys.matlab:465761


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')