[Numpy-discussion] How to limit cross correlation window width in Numpy?

Sturla Molden sturla.molden at gmail.com
Wed Jun 17 18:13:25 EDT 2015

On 17/06/15 04:38, Honi Sanders wrote:

> I have now implemented this functionality in numpy.correlate() and numpy.convolve(). https://github.com/bringingheavendown/numpy. The files that were edited are:
> numpy/core/src/multiarray/multiarraymodule.c
> numpy/core/numeric.py
> numpy/core/tests/test_numeric.py
> Please look over the code, my design decisions, and the unit tests I have written. This is my first time contributing, so I am not confident about any of these and welcome feedback.

I'll just repeat here what I already said on Github.

I think this stems from the need to compute cross-correlograms as used 
in statistical signal analysis, whereas numpy.correlate and 
scipy.signal.correlate are better suited for matched filtering.

I think the best solution would be to add a function called 
scipy.signal.correlogram, which would return a cross-correlation and an 
array of time lags. It could take minlag and maxlag as optional arguments.

Adding maxlag and minlag arguments to numpy.convolve makes very little 
sense, as far as I am concerned.


More information about the NumPy-Discussion mailing list