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

Home » Public Forums » archive » convolution of 1-D array with a function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
convolution of 1-D array with a function [message #94227] Wed, 01 March 2017 23:55 Go to next message
Krishnakumar M.A is currently offline  Krishnakumar M.A
Messages: 19
Registered: March 2013
Junior Member
Hi there,

I was trying to convolve a 1-D array (a Gaussian) with an exponentially decreasing function. I have not used the convol() function in IDL, but will this work for such 1-D arrays, or are there any other functions which does this?

Any help is appreciated.
Re: convolution of 1-D array with a function [message #94229 is a reply to message #94227] Thu, 02 March 2017 00:47 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, March 2, 2017 at 8:55:26 AM UTC+1, Krishnakumar M.A wrote:
> Hi there,
>
> I was trying to convolve a 1-D array (a Gaussian) with an exponentially decreasing function. I have not used the convol() function in IDL, but will this work for such 1-D arrays, or are there any other functions which does this?
>
> Any help is appreciated.

Hi,
I'm not sure about the details, but this looks pretty close to correct convoluting a step function with a gaussian:

x = findgen(101)/10.0-5.0
y = exp(-x*x/2.0)
ps = plot(x,y,'2r', yRange=[-0.05,1.05], name='Gaussian')
yStep = x
yStep[0:50] = 0.0
yStep[51:100] = 1.0
op = plot(x,yStep, '2g', overplot=ps, name='Step function')
yConv = convol(yStep,y, /edge_trunc, /center, /norm)
opc = plot(x,yConv, '2b', overplot=ps, name='convolution')
ll = legend(target=[ps,op,opc], position=[-3.5,0.85], vertical_alignment=0.5, horizontal_alignment=0.5, /data, /auto_text_color)

cheers,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Recovering Object Oriented References
Next Topic: NetCDF version in IDL 8.6?

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

Current Time: Wed Oct 08 07:14:40 PDT 2025

Total time taken to generate the page: 0.00430 seconds