[PYTHON MATRIX-SIG] autocorrelation functions?

Rob.Hooft@embl-heidelberg.de Rob.Hooft@embl-heidelberg.de
Mon, 14 Oct 1996 10:48:29 +0200 (MET DST)


>>>>> "DA" == David Ascher <da@maigret.cog.brown.edu> writes:

 DA> What's a smart (read efficient, and possibly neat) way of doing
 DA> autocorrelation in NumPython?  I'm looking for both 1D and 2D
 DA> with a city-block metric to start with (a cartesian metric would
 DA> be good too, but I suspect that's harder to optimize).

 DA> I'm sure there's a good way to do this, I just can't figure it
 DA> out...

Isn't the O(n^2) operation of autocorrelation mathematically
equivalent to the O(n ln n) auto-convolution operation?

    ac(x)=inverse_fft(fft(x)^2)

Rob
-- 
=== Rob.Hooft@EMBL-Heidelberg.DE   http://www.Sander.EMBL-Heidelberg.DE/rob/ ==
==== In need of protein modeling?  http://www.Sander.EMBL-Heidelberg.DE/whatif/
Validation of protein structures?  http://biotech.EMBL-Heidelberg.DE:8400/ ====
== PGPid 0xFA19277D == Use Linux!  Free Software Rules The World! =============

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================