Re: Does CONVOL convolute [message #34160 is a reply to message #34158] |
Mon, 24 February 2003 11:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Big Bird (condor@biosys.net) writes:
> But leaving the kernel alone, and just making the original array
> unsymmetric, I get something entirely unexpected:
>
> IDL> tt = fltarr(5,5)
> IDL> tt[0,0] = 1
> IDL> print,tt
> 1.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
> IDL> print,convol(tt,k)
> 0.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 1.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
> 0.00000 0.00000 0.00000 0.00000 0.00000
>
> Huh?
>
> I get the same results with or without the /center keyword to convol.
Setting CENTER=1 or /CENTER is the same as leaving the CENTER
keyword off. (Don't ask!) If you want to perform convolution in
the "strictly mathematical" sense, you must explicitly set CENTER=0.
Is this what you were after:
IDL> print,convol(tt,k, center=0)
0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 1.00000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|