Path: news.mathworks.com!not-for-mail
From: "h xu" <quabla123@gmx.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fft sign?
Date: Sun, 4 May 2008 13:09:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 57
Message-ID: <fvkchf$jip$1@fred.mathworks.com>
References: <fv7gge$a1d$1@fred.mathworks.com> <fv9nd5$9oe$1@fred.mathworks.com> <fvadt7$e6u$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 1209906543 20057 172.30.248.35 (4 May 2008 13:09:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 May 2008 13:09:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1370985
Xref: news.mathworks.com comp.soft-sys.matlab:466504


"David " <dave@bigcompany.com> wrote in message
<fvadt7$e6u$1@fred.mathworks.com>...
> "h xu" <quabla123@gmx.de> wrote in message <fv9nd5
> $9oe$1@fred.mathworks.com>...
> > "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') 
> > > 
> > > 
> > 
> > 
> > hm but i want to transformate functions, that 
> transformated
> > also have a imaginary part, so what do i need to do, to 
> have
> > the sign right for every value?
> 
> try:
> y= -1*exp(3* i*(pi/xmax) *x);
> 
> yes, it looks the same on the surface... but it REALLY 
> isn't.

mhm, sure for y=exp(n* i*(pi/xmax) *x) with n=3 or any other
odd number, the fft of y'=-y would change the amplitude from
negative to positive, but then the sign would be wrong if I
had even n. 

well the exp() thing was just to make my problem with wrong
amplitude-sign clear.

my question is what i need to do to get the sign of the
ft-amplitude right for a abritary (also complex) function.

and also why sometimes the sign is false.