comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: FFT help
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: FFT help [message #41620 is a reply to message #41618] Fri, 05 November 2004 06:23 Go to previous messageGo to previous message
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
"IDLmastertobe" <shi_lee@hotmail.com> wrote:

> Hey, I am experiencing problem using fft function. Since FFT function
> provides the fourier transform of a certain input, for example,
> 8*cos(!PI*x/6),

First of all, this is a function. Please supply the min and max
values of x.

> I would expect an amplitude of 4 at 2 shifted frequencies,
> namely -!PI/6 and PI/6.

This should occur for an infinite number of values.

> However after I recieved data from the FFT, I
> recieved some amplitudes close to 2 at some random locations, can anyone
> explain to me why it happened? Thanks for your time.

I tried to check with the following code:

x=findgen(1000)/10
y = 8*cos(x)
plot, y
z = fft(y)
plot, abs(z)
print, max(abs(z))
; 3.32737

I get a distribution with peaks at x=1 and x=998 and a maximum of 3.32737.
Next I used 10,000 numbers and looked at
plot, [abs(z[0:20]),abs(z[9979:9999])]

Two peaks with 3.94421 as maximum values. So it approaches 4 as you expected.

HTH
Norbert
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: About Image Formats
Next Topic: Re: IDL PET/CT Viewer and Analysis package

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 22:30:12 PDT 2025

Total time taken to generate the page: 0.55869 seconds