[SciPy-user] slow fft time

Ryan Krauss ryanfedora at comcast.net
Sat May 14 21:20:31 EDT 2005


Thanks Perry.  I did not know that prime number of elements was bad.  I 
knew that 2^N was good, but Matlab always did them so fast that I never 
worried about making them 2^N.  But there were almost always of an even 
length, so I never hit a prime number.  There is already a little zero 
padding on this data, so just changing from 21001 element to 21000 took 
my FFT time from over 7secs to 0.045secs.  So, I still won't worry about 
2^N, but I will avoid prime number lengths.

Thanks again.

Ryan

Perry Greenfield wrote:

> You do realize that 21001 is prime, and that FFTs are not 'fast' for 
> prime numbers of elements?
> Try padding the array to make it a power of 2 number of elements (or 
> at least a product of many
> small primes)
>
> Perry Greenfield
>
> On May 14, 2005, at 8:20 PM, Ryan Krauss wrote:
>
>>  I thought maybe I had screwed something up in my install and it 
>> wasn't using ATLAS or something, but I ran this same code from 
>> windows where I had in stalled from 
>> SciPy_complete-0.3.2.win32P4SSE2-py2.3-num23.5.exe and 
>> Numeric-23.8.win32-py2.3.exe.  It takes even longer in windows - 
>> maybe 20secs (I am ordinarily running FC3 linux with kde).
>>
>>  Ryan
>>
>>
>>  Ryan Krauss wrote:
>>  I am trying to process some experimental data and I need to do a 
>> bunch of fft's.  The time domain matrices are column vectors that are 
>> 21001 elements and there are 3 columns.  It is taking 7 seconds or so 
>> to execute the fft command:
>>
>>  In [73]: shape(curtmat)
>>  Out[73]: (21001, 3)
>>
>>  In [74]: type(curtmat)
>>  Out[74]: <type 'array (scipy)'>
>>
>>  In [75]: fftmat=fft(curtmat,None,0)
>>
>>  Am I doing something wrong?  Does this seems like a normal ammount 
>> of time to anyone else?  What can I do to make this better?
>>
>>  Ryan
>>
>>
>>
>> _______________________________________________
>> SciPy-user mailing list
>>  SciPy-user at scipy.net
>>  http://www.scipy.net/mailman/listinfo/scipy-user
>>
>>
>>  _______________________________________________
>> SciPy-user mailing list
>> SciPy-user at scipy.net
>> http://www.scipy.net/mailman/listinfo/scipy-user
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>




More information about the SciPy-User mailing list