I have a function, since I have to do infinite summation over (over all integers) numerically. Summation does not always have to converge, since I can change the internal parameters. The function looks like this:
m(g, x, q0) = sum(abs(g(x - n*q0))^2 for n in Integers) m(g, q0) = minimize(m(g, x, q0) for x in [0, q0])
using pseudo code Pythonic
Using the Scipy integration methods, I just flooring n and integrated, as with fixed x,
m(g, z, q0) = integrate.quad(lambda n: abs(g(x - int(n)*q0))**2, -inf, +inf)[0]
This works very well, but then I need to do the optimization on x as a function of x, and then do another summation on what gives the integral of the optimization of the integral. To a large extent this takes a very long time.
Do you know that it is better to do the summation faster? Manual coding seemed slow to him.
I am currently working with
g(x) = (2/sqrt(3))*pi**(-0.25)*(1 - x**2)*exp(-x**2/2)
but the solution must be general
Document from Wavelet Conversion, Time Localization, and Signal Analysis by Daubechies (IEEE 1990)
thanks