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

Home » Public Forums » archive » Convolution, IDL & Numerical Recipes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Convolution, IDL & Numerical Recipes [message #32678] Thu, 31 October 2002 12:50 Go to previous message
aceves is currently offline  aceves
Messages: 4
Registered: October 2002
Junior Member
Hello..

I am using IDL for some of my research and have a particular problem
with convolution of two arrays. I have used IDL's CONVOL procedure
and subroutine CONVLV given in NUMERICAL RECEIPES..both give
different results. I hope some one can shed light on what the
reason might be.

Thank you. Hector

*********
Problem:
*********

At the IDL prompt I entered and obtained:
----------

IDL> a=[0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0] ; signal!
IDL> k=[1,0,0,0,0,0,0,0,0] ; kernel!
IDL> z=convol(a,k)
IDL> print, z
0 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0


With Numerical Receipes (Example Book in Fortran, Program XCONVLV, Chap.13)
----------------------

The Signal file, or Data is (ibin,DATA)

1 0.
2 0.
3 0.
4 0.
5 0.
6 1.
7 1.
8 1.
9 1.
10 1.
11 0.
12 0.
13 0.
14 0.
15 0.
16 0.

The Kernel or Response Function is (jbin,RESPNS=KERNEL) ..an identity filter

1 1.
2 0.
3 0.
4 0.
5 0.
6 0.
7 0.
8 0.
9 0.

The Fortran program gives (ibin,Convolution,Expected value):

I CONVLV Expected

1 0.000000 0.000000
2 0.000000 0.000000
3 0.000000 0.000000
4 0.000000 0.000000
5 0.000000 0.000000
6 1.000000 1.000000
7 1.000000 1.000000
8 1.000000 1.000000
9 1.000000 1.000000
10 1.000000 1.000000
11 0.000000 0.000000
12 0.000000 0.000000
13 0.000000 0.000000
14 0.000000 0.000000
15 0.000000 0.000000
16 0.000000 0.000000

-----
As shown, the results given by the numerical subroutine from NR
gives the expected results and differ from the one by IDL's CONVOL.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: registering images, shift(/nowrap)
Next Topic: Re: PRINT on same line

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

Current Time: Wed Oct 08 15:40:02 PDT 2025

Total time taken to generate the page: 0.00462 seconds