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

Home » Public Forums » archive » Re: FFT of gaussian
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: FFT of gaussian [message #74382] Wed, 12 January 2011 12:20
Mark Piper is currently offline  Mark Piper
Messages: 198
Registered: December 2009
Senior Member
On Jan 12, 10:42 am, Gray <grayliketheco...@gmail.com> wrote:
>
> Ah, the shift(abs()) helped very much!  Thanks :)

A small aside: the CENTER keyword was added to FFT in IDL 7.1. With
it, the last two lines of Ken's example become:

IDL> yt = fft(y, /center)
IDL> plot, abs(yt)

I always disliked having to shift the Fourier coefficients.
Re: FFT of gaussian [message #74389 is a reply to message #74382] Wed, 12 January 2011 09:42 Go to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On Jan 12, 9:28 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < e8f1db77-67a5-491f-9671-fbd85c50a...@a10g2000vby.googlegroup s.com >,
>
>  Gray <grayliketheco...@gmail.com> wrote:
>> Hi all,
>
>> Here's something I don't really understand.  The Fourier transform of
>> a Gaussian function is another Gaussian... so why if I create a
>> Gaussian and run FFT do I not get a Gaussian?  Is it because my
>> Gaussian vector is discrete?  How can I fix this?
>
> You get the discrete transform of a discrete approximation to
> a Gaussian, which is also a discrete approximation to a Gaussian.  
>
> Try this:
>
> IDL> x = -5.0d0 + 0.1d0*dindgen(101)
> IDL> y = exp(-(x^2))                
> IDL> plot, x, y                    
> IDL> yt = fft(y)                    
> IDL> plot, shift(abs(yt),50)
>
> Don't forget, the IDL always does a full complex FFT.      
>
> Ken Bowman

Ah, the shift(abs()) helped very much! Thanks :)
Re: FFT of gaussian [message #74390 is a reply to message #74389] Wed, 12 January 2011 06:28 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<e8f1db77-67a5-491f-9671-fbd85c50a7b6@a10g2000vby.googlegroups.com>,
Gray <graylikethecolor@gmail.com> wrote:

> Hi all,
>
> Here's something I don't really understand. The Fourier transform of
> a Gaussian function is another Gaussian... so why if I create a
> Gaussian and run FFT do I not get a Gaussian? Is it because my
> Gaussian vector is discrete? How can I fix this?

You get the discrete transform of a discrete approximation to
a Gaussian, which is also a discrete approximation to a Gaussian.

Try this:

IDL> x = -5.0d0 + 0.1d0*dindgen(101)
IDL> y = exp(-(x^2))
IDL> plot, x, y
IDL> yt = fft(y)
IDL> plot, shift(abs(yt),50)

Don't forget, the IDL always does a full complex FFT.

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: map_proj_inverse question
Next Topic: 2d min

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

Current Time: Fri Oct 10 15:24:25 PDT 2025

Total time taken to generate the page: 0.96394 seconds