On Mon, Mar 30, 2009 at 12:23 PM, Anne Archibald <[email protected]>wrote:
> 2009/3/30 João Luís Silva <[email protected]>: > > Hi, > > > > I wrote a script to calculate the *optical* autocorrelation of an > > electric field. It's like the autocorrelation, but sums the fields > > instead of multiplying them. I'm calculating > > > > I(tau) = integral( abs(E(t)+E(t-tau))**2,t=-inf..inf) > > You may be in trouble if there's cancellation, but can't you just > rewrite this as E(t)**2+E(t-tau)**2-2*E(t)*E(t-tau)? Then you have two > O(n) integrals and one standard autocorrelation... > That should work. The first two integrals are actually the same, but need to be E(t)*E(t).conj(). The second integral needs twice the real part of E(t)*E(t-tau).conj(). Numpy correlate should really have the conjugate built in, but it doesn't. Chuck
_______________________________________________ Numpy-discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
