[MATRIX-SIG] Question about Numeric.convolve
Mike Miller
miller5@uiuc.edu
10 Feb 1998 14:33:09 -0600
I'm (trying) to use convolve to convolute a calculation with
Gaussian resolution and am having some trouble sorting things
out. I have two arrays, x and f = f(x) and I'd like to convolute
f(x) with a Gaussian. So I calculate an array g like this:
g = Numeric.zeros( x.shape,'Float').real
for i in range(len(g)):
g[i] = math.exp(-(math.pow((x[i]-mu)/sigma,2)))
and convolute the two arrays like this:
fg = Numeric.convolve( f, g, 0 )
I've been fiddling with this for a while now, adjusting the
location of the Gaussian, zero extending f and g at either end,
but I can't seem to sort out where convolve puts the result in
fg. I'd like to be able to plot both f and fg versus x to see
the result.
So, the question is - is there a way to convolute two arrays with
x, rather than the array index, as the index. Or am I just
totally clueless? Or both?
Mike
--
Michael A. Miller miller5@uiuc.edu
Department of Physics, University of Illinois, Urbana-Champaign
PGP public key available on request
_______________
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________