Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-09-01 Thread Charles R Harris
On Tue, Sep 1, 2015 at 12:06 PM, Oscar Benjamin wrote: > > On Tue, 1 Sep 2015 18:43 Phil Hodge wrote: > > On 09/01/2015 11:14 AM, Oscar Benjamin wrote: > > Just use the next power of 2. Pure powers of 2 are the most efficient > > for FFT algorithms so it potentially works out better than finding

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-09-01 Thread Oscar Benjamin
On Tue, 1 Sep 2015 18:43 Phil Hodge wrote: On 09/01/2015 11:14 AM, Oscar Benjamin wrote: > Just use the next power of 2. Pure powers of 2 are the most efficient > for FFT algorithms so it potentially works out better than finding a > smaller but similarly composite size to pad to. Finding the nex

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-09-01 Thread Phil Hodge
On 09/01/2015 11:14 AM, Oscar Benjamin wrote: > Just use the next power of 2. Pure powers of 2 are the most efficient > for FFT algorithms so it potentially works out better than finding a > smaller but similarly composite size to pad to. Finding the next power > of 2 is easy to code and never a ba

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-09-01 Thread Joseph Codadeen
see if I can boost the performance further.Thanks. > From: oscar.j.benja...@gmail.com > Date: Tue, 1 Sep 2015 16:14:41 +0100 > To: numpy-discussion@scipy.org > Subject: Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples > > On 1 September 2015 at 11:38, Joseph Codadee

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-09-01 Thread Oscar Benjamin
On 1 September 2015 at 11:38, Joseph Codadeen wrote: > >> And while you zero-pad, you can zero-pad to a sequence that is a power of >> two, thus preventing awkward factorizations. > > Does numpy have an easy way to do this, i.e. for a given number, find the > next highest number (within a range) t

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-09-01 Thread Joseph Codadeen
t gave a list, prioritised by number of factors.Thanks,Joseph Date: Fri, 28 Aug 2015 17:26:32 -0700 From: stef...@berkeley.edu To: numpy-discussion@scipy.org Subject: Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples On Aug 28, 2015 5:17 PM, "Pierre-Andre Noel" wrote:

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stéfan van der Walt
On Aug 28, 2015 5:17 PM, "Pierre-Andre Noel" wrote: > > I had in mind the use of FFT to do convolutions ( > https://en.wikipedia.org/wiki/Convolution_theorem ). If you do not > zero-pad properly, then the end of the signal may "bleed" on the > beginning, and vice versa. Ah, gotcha! All these thin

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Pierre-Andre Noel
> Zero-padding won't help with the non-periodicity, will it? For > that you may want to window instead. Umh, it depends what you use the FFT for. You are right Stéfan when saying that Joseph should probably also use a window to get rid of the high frequencies that will come from the sharp ste

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stefan van der Walt
On 2015-08-28 16:20:33, Pierre-Andre Noel wrote: > If your sequence is not meant to be periodic (i.e., if after one > minute there is no reason why the signal should start back at > the beginning right away), then you should do zero-padding. And > while you zero-pad, you can zero-pad to a s

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Pierre-Andre Noel
If your sequence is not meant to be periodic (i.e., if after one minute there is no reason why the signal should start back at the beginning right away), then you should do zero-padding. And while you zero-pad, you can zero-pad to a sequence that is a power of two, thus preventing awkward facto

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Eric Firing
:13 +, Joseph Codadeen wrote: >> Great, thanks Stefan and everyone. >> >>> From: stef...@berkeley.edu >>> To: numpy-discussion@scipy.org >>> Date: Fri, 28 Aug 2015 12:03:52 -0700 >>> Subject: Re: [Numpy-discussion] Numpy FFT.FFT slow with c

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Sebastian Berg
+, Joseph Codadeen wrote: > Great, thanks Stefan and everyone. > > > From: stef...@berkeley.edu > > To: numpy-discussion@scipy.org > > Date: Fri, 28 Aug 2015 12:03:52 -0700 > > Subject: Re: [Numpy-discussion] Numpy FFT.FFT slow with certain > samples > > >

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Joseph Codadeen
Great, thanks Stefan and everyone. > From: stef...@berkeley.edu > To: numpy-discussion@scipy.org > Date: Fri, 28 Aug 2015 12:03:52 -0700 > Subject: Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples > > > On 2015-08-28 11:51:47, Jose

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stefan van der Walt
On 2015-08-28 11:51:47, Joseph Codadeen wrote: > my_1_minute_noise_with_gaps_truncated - Array len is > 2646070my_1_minute_noise_with_gaps - Array len is 2649674 In [6]: from sympy import factorint In [7]: max(factorint(2646070)) Out[7]: 367 In [8]: max(factorint(2649674)) Out[8]: 1324837

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Joseph Codadeen
my_1_minute_noise_with_gaps_truncated - Array len is 2646070my_1_minute_noise_with_gaps - Array len is 2649674 > Date: Fri, 28 Aug 2015 14:28:49 -0400 > From: ho...@stsci.edu > To: numpy-discussion@scipy.org > Subject: Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples &

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Phil Hodge
On 08/28/2015 02:02 PM, Joseph Codadeen wrote: > > * my_1_minute_noise_with_gaps_truncated took***30.75620985s* to process. > * my_1_minute_noise_with_gaps took *22307.13917s*to process. > You didn't say how long those arrays were, but I can make a good guess that the truncated one had a leng