Re: what is the dist function's mean? [message #43710 is a reply to message #43549] |
Sat, 23 April 2005 10:16   |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
lixiaoyao wrote:
> I still a little bit confusing about the use of it.I will read the
> manual again.thank you.
>
Chapter 21, "Signal Processing", in the "Using IDL" manual is quite
helpful. It sais that if you use the FFT() function on some sampled
data, the actual frequency associated with a frequency index m is
f(m) = m / (N delta)
where N is the number of data points (in that dimension) and delta is
the sampling interval. The online help to FFT() explains which array
index corresponds to which frequency index:
0, 1, 2, ..., N/2-1, N/2, -(N/2-1), ..., -1
if you have an even number of data points. So, if you do a 2-dimensional
F.T. (say, of an N x N array), DIST() will give you the frequency
indices. Then you can create an array with spatial frequencies by
freq = dist(N, N) / (N * delta)
where delta is your real space sampling interval.
If this is what you have to work on, you should fully understand
discrete Fourier transforms before you try to do calculations in IDL. I
can recommend the book "The Fast Fourier Transform" by E. Oran Brigham.
Benjamin
|
|
|