[SciPy-User] Discrete integration with delays

Thomas Fitzpatrick tcf4@njit....
Thu Sep 2 18:02:55 CDT 2010


Can anybody help me with the following equation? It is similar to a correlation,
but I am not sure how this done as scipy's correlation packages are compiled
into a pyd sigtools. I would like to get an array that is the same size as the
input.

Here is the equation I am trying to code:

F(T) = integration[{I(t) + I(t - T)}*E(t)*Econj(t - T)]dt from -inf to +inf
(The code be for a discrete function)


I tried to do it by adapting this autocorrelation function:

N = len(x)
Rxx = np.zeros(N)

for m in range(N):
    for n in range(N-m):
        Rxx[m] = Rxx[m] + x[n]*x[n+m-1]


Here is my attempt:

f1 = np.zeros(N)
for m in range(N):
    for n in range(0, N - m):
        f1[m] = f1[m] + .5*(it[n] + it[n + m])*et[n]*et[n + m]

This works pretty well, but it doesn't return an array of the same size as the
input which is an option for the scipy function 'correlate.'



More information about the SciPy-User mailing list