[SciPy-User] frequency components of a signal buried in a noisy time domain signal

Ivo Maljevic ivo.maljevic@gmail....
Sat Feb 27 12:32:31 CST 2010


Thanks Robert. I figured that after I sent the question, but I am not sure
if the search based solution offers any advantage in terms of speed.
Besides, and not that it matters really, but that solution restricts the
usage to max 2**32 integer result on 32 bit machines, whereas log based one
doesn't:

>>> def nextpow2(n):
...   return 2**(np.ceil(np.log2(n)))
...
>>> np.iinfo(np.intp).bits
32
>>> n=2**32+300.5
>>> n
4294967596.5
>>> nextpow2(n)
8589934592.0

On 27 February 2010 13:02, Robert Kern <robert.kern@gmail.com> wrote:

> On Sat, Feb 27, 2010 at 04:02, Ivo Maljevic <ivo.maljevic@gmail.com>
> wrote:
> > David,
> > Nice way of avoiding log2, but how do you determine the length of your
> tab
> > array?
>
> The input arrays can only be so large. Even on 64-bit machines, the
> table need not have more than 64 entries.
>
>  tab = 2 ** np.arange(np.iinfo(np.intp).bits)
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100227/067aece4/attachment.html 


More information about the SciPy-User mailing list