vectorizing a correlation calculation [message #2179] |
Fri, 03 June 1994 08:52 |
orbach
Messages: 9 Registered: June 1994
|
Junior Member |
|
|
I have written a routine to calculate a function which is very similar
to an autocorrelation function, from an array containing neuronal spiking times
(in fact, many neurophysiologists actally call this function an autocorrelation,
but this is slightly inexact). The output of the calculation is a new array which
describes, given a spike at time t = 0, how likely it is for there to be another
spike at various times t afterwards. The user specifies how far out from time
t = 0 the function should be calculated (Tmax), as well as the binsize of the
histogram. My function literally walks through the array, spike by spike,
performing the built-in "histogram" function to calculate that spike's local density
function, adding successive outputs in turn.
Needless to say this is a slow process, and I was wondering if anyone had any
ideas about how to vectorize this calculation so that I could use operations on arrays
rather than looping through the array of spiketimes. An alternative approach would
be to calculate this density function from the reverse Fourier Transf. of the power
spectrum of the original spiketrain (up to some minor housekeeping details). However,
this actually takes longer than does doing it the way I described above.
Any ideas, either posted here or sent directly to me, would be greatly
appreciated. -Darren Orbach
|
|
|