Re: Convolving a vector with the 2nd derivative of a Gaussian [message #74070] |
Wed, 29 December 2010 22:09 |
MC
Messages: 50 Registered: September 1996
|
Member |
|
|
On Dec 30, 8:37 am, johan <j...@skvera.co.uk> wrote:
> I am trying to do something that must be straigtforward but I don't
> seem to get my head around it.
>
> I have a vector, say
> A = [20, 20, 20, 21, 26, 48, 88, 105, 182, 182, 241, 245, 241, 182,
> 182, 105, 88, 48, 26, 21, 20, 20, 20, 20]
>
> I want to convolve it with the 2nd derivative of a Gaussian with a
> sigma of 10.
>
> Is the CONVOL of IDL suitable anf how do I construct the kernel?
>
> Help will be greatly apprecuated.
The second derivative of exp((-x^2)/a) is
-(2/a)exp((-x^2)/a)+(4x^2/a^2)exp((-x^2)/a)
(if my basic calculus has not failed me).
You can make "x" by (say) x=findgen(24)-12. the constant "a" in the
above is given in Wikipedia (etc.) in terms of sigma -look it up.
Yes, convol works. I suggest that such basic IDL programming questions
suggest you need to try the IDL tutorial. You really need to do this
for yourself to start to understand functions an proceedures.
Good luck.
MC
|
|
|