Re: IDL EPA Exam Test Question [message #21537] |
Thu, 31 August 2000 00:00 |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
David Fanning, davidf@dfanning.com writes:
> The Exam Committee chairman has run off with the
> secretary over in the Bookstore and no one seems to
> know when he is coming back. So I've been asked to
> get a couple of exam questions together.
Hmmm. Now we all know the answer you're going to have to think of
a better one. Actually, you already have. A standard goat-from-sheep
sort algorithm is to ask the interviewee what they would ask if they
were the interviewer. You've already done that. Game over.
Thing is. Did you know I knew you knew I know?
Struan
|
|
|
|
Re: IDL EPA Exam Test Question [message #21553 is a reply to message #21552] |
Wed, 30 August 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
davidf@dfanning.com (David Fanning) writes:
> This is actually a serious question that I was
> asked today from one of my e-mail friends. I know
> it is used to build "frequency images", but what
> are those and how does a DIST image work in that
> context?
When you take the FFT of an image the meaning of coordinate axes
change. In a transformed image, the coordinates label the *frequency*
of each pixel. The FFT attempts to decompose the image or signal into
oscillating sine waves with various frequencies; the result is the
amplitude of each wave.
In a 1D transformed image, pixel 0 is the DC amplitude, pixel 1 is the
amplitude of the slowest varying wave, and so on for higher frequency
waves. For a 2D transformed image you have both an "X" frequency and
a "Y" frequency -- a frequency "image." The fourier transform also
keeps track of "negative" frequencies, which for some reason are kept
in the second half of the vector.
DIST computes the frequency of each element in such a 2D transformed
image --- or at least is proportional to it. This would be useful if
you are applying filtering in the frequency domain. For example if
you wanted to apply an exponential filter to attenuate the high
frequency amplitudes in a 128x128 array, you might do this:
freq = dist(128,128)
fim = fft(im)*exp(-freq)
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: IDL EPA Exam Test Question [message #21554 is a reply to message #21552] |
Wed, 30 August 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Andy Loughe (loughe@fsl.noaa.gov) writes:
> As it says in the on-line help (no kidding)...
>
> "Making pretty pictures."
>
> Do I win?
Yes, Andy. And you get the same prize I give
my children when they win these kinds of contests:
a hug and a kiss! :-)
This is actually a serious question that I was
asked today from one of my e-mail friends. I know
it is used to build "frequency images", but what
are those and how does a DIST image work in that
context?
Cheers,
David
P.S. Let's just say I hope I run into you on
the Mall when it comes time for payment. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: IDL EPA Exam Test Question [message #21555 is a reply to message #21552] |
Wed, 30 August 2000 00:00  |
Andy Loughe
Messages: 174 Registered: November 1995
|
Senior Member |
|
|
David Fanning wrote:
>
> Hi Folks,
>
> The Exam Committee chairman has run off with the
> secretary over in the Bookstore and no one seems to
> know when he is coming back. So I've been asked to
> get a couple of exam questions together. I don't want
> to be unfair or anything, so I thought I would throw
> out a test question to see if I'm on the right track.
>
> Ready?
>
> What is the *real* purpose of the DIST function?
As it says in the on-line help (no kidding)...
"Making pretty pictures."
Do I win?
--
Andrew Loughe =====================================================
NOAA/OAR/FSL/AD R/FS5 | email: loughe@fsl.noaa.gov
325 Broadway | wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO 80305-3328 | phone: 303-497-6211 fax: 303-497-6301
|
|
|