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 #41618 is a reply to message #41617] Fri, 05 November 2004 06:43 Go to previous messageGo to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article
<26d23fcf09dce26228fc67cf81ec832f@localhost.talkaboutprogramming.com>,
"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), I would expect an amplitude of 4 at 2 shifted frequencies,
> namely -!PI/6 and PI/6. 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.
>

This function

COS(!PI*x/6.0)

is only a small part of a complete cosine wave and has a jump
discontinuity at the ends. (Try plotting it.)

Perhaps you mean

IDL> x = findgen(16)/16.0
IDL> xx = fft(8.0*cos(6.0*!pi*x))
IDL> for i = 0, 15 do print, xx[i]
( 1.66889e-07, 0.00000)
( 9.40551e-07, 2.41026e-07)
( -1.35589e-07, 6.01780e-07)
( 4.00000, 6.09532e-07)
( -3.99355e-07, 2.98023e-08)
( -2.53313e-07, 1.34857e-08)
( 1.59439e-07, -5.38710e-08)
( -4.56263e-07, -2.95416e-07)
( 5.84122e-07, -0.00000)
( -4.56263e-07, 2.95416e-07)
( 1.59439e-07, 5.38710e-08)
( -2.53313e-07, -1.34857e-08)
( -3.99355e-07, -2.98023e-08)
( 4.00000, -6.09532e-07)
( -1.35589e-07, -6.01780e-07)
( 9.40551e-07, -2.41026e-07)

Ken Bowman
[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: Sat Oct 11 04:56:48 PDT 2025

Total time taken to generate the page: 1.11545 seconds