Re: FFT of gaussian [message #74382] |
Wed, 12 January 2011 12:20 |
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  |
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  |
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
|
|
|