CONVOL with 2D array and 1D kernel [message #52983] |
Fri, 09 March 2007 06:32 |
Eric Hudson
Messages: 19 Registered: June 2006
|
Junior Member |
|
|
Hi,
I have a strange problem with CONVOL (stranger I think than the
typical). I have a 2D array (15000x41) that I want to convolve with a
symmetric 1d kernel (1x5). If I do the following:
convol(2darr,kernel,/edge_truncate)
it returns an array the size of 2darr as expected EXCEPT row 39 is all
0. If I take a small subset of the 2darr:
convol(2darr[0:486,*],kernel,/edge_truncate)
then it works (i.e. row 39 isn't 0). If I add just one more curve:
convol(2darr[0:487,*],kernel,/edge_truncate)
then suddenly row 39 in all curves is 0.
Nothing else changes -- all 40 other rows are right. Anyone have any
idea what is going on? I'm using IDL 6.0.
Also, there seems to be a lot of confusion about what CONVOL really
does. Is there a definitive, readable, source so I can make sure that
I'm really doing what I want here (a true mathematical convolution
where I've made the array a bit bigger on the edges by duplicating the
top & bottom rows, done the convolution, and then chopped off the
edges to minimize edge effects).
Thanks,
Eric
|
|
|