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 #41617 is a reply to message #41616] Fri, 05 November 2004 07:31 Go to previous messageGo to previous message
Timm Weitkamp is currently offline  Timm Weitkamp
Messages: 66
Registered: August 2002
Member
Today at 08:43 -0600, Kenneth Bowman wrote:

> [...]
>
> 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.)

Mhm, but the discontinuity can be avoided if you use a grid that takes an
integer number of periods of your function, for example:

IDL> x = findgen(120)
IDL> y = 8 * cos(2*!pi*x/6)
IDL> ft = fft(y)
IDL> plot, abs(ft)

The result is pretty much what the original poster expected to get: two
peaks with values of exactly 4, at positions of 20 (=120/6) and 100 (the
mirrored peak -- see the online help for FFT for how the frequencies are
ordered in the output of FFT) on the frequency axis.

Good luck
Timm

--
Timm Weitkamp <http://people.web.psi.ch/weitkamp>
[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 08:31:10 PDT 2025

Total time taken to generate the page: 0.80005 seconds