[Numpy-discussion] help to speed up the python code

Charles R Harris charlesr.harris@gmail....
Fri Oct 31 12:54:54 CDT 2008


On Thu, Oct 30, 2008 at 11:44 PM, frank wang <f.yw@hotmail.com> wrote:

>  Hi, Bob,
>
> The problem is that I want to resample my data with another sampling rate.
> the two rates is very close. I use the formula:
>
> s(t)=sum(a_k*sinc(t-kTs)).
>
> the new sampling rate is Ts', so I have
> s(nTs')=sum(a_k*sinc(nTs'-kTs)). The sum index k is over the (-P, P),
> Centered at n. The n is start from zero. THe code is using two for loops and
> it is slow. The length of s(nTs) is very long, so it takes quite long time
> to do it.
>
>

I think you can use some form of chirpz/Bluestein for this. Just think of
the data as the Fourier transform of its spectrum.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081031/6ecdff5a/attachment.html 


More information about the Numpy-discussion mailing list