[SciPy-user] 1D Correlation on 3D array

Ryan May rmay@ou....
Fri Nov 30 15:56:26 CST 2007


Hi,

I was curious if anyone has a fast non-looping way to calculate 1D
correlations on a N-dim array (my case is specifically 3).

What i have right now is rather slow:

import numpy as N
from scipy.signal import correlate

ts_data = N.ones((360,1201,17), dtype=N.complex64)
for index in N.ndindex(ts_data.shape[:-1]):
    x = ts_data[index]
    R = correlate(x, x.conj())

I've looked at just passing in the whole array, but that seems to want
to do full N-dim correlation.

Thanks,

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma


More information about the SciPy-user mailing list