On Sat, Oct 25, 2008 at 9:34 AM, Gabriel Gellner <[EMAIL PROTECTED]> wrote: > > On Sat, Oct 25, 2008 at 12:12:18PM -0400, Gabriel Gellner wrote: >> >> On Sat, Oct 25, 2008 at 10:40:33AM -0500, Jason Grout wrote: >> > >> > David Joyner wrote: >> > > (1) Sage also does FFT via the GSL. I guess they didn't try that, >> > > but I would imaginge they would be fast since they are in C. >> > >> > >> > The current CDF and RDF vectors implement fft using GSL. I'm in the >> > process of switching the RDF/CDF vector backend to numpy, and then the >> > fft will be done by numpy. I'm curious where the FFT is done by numpy >> > currently; I couldn't find the code. Of course, the reviewer used an >> > extremely old version of Sage (on our timescale), so maybe things were >> > different then. >> > >> > For matrices, switching to numpy made most things faster, so I'm curious >> > what we'll find when we switch the vectors to numpy as a backend. >> > >> Also Sage could use fftw unlike numpy (as it is gpl) which usually beats the >> pants of fftpack (which is what numpy uses) See: >> http://www.fftw.org/ >> >> According to the fftw benchmarks for speed: gsl < fftpack < fftw see: >> http://www.fftw.org/speed/CoreDuo-3.0GHz-icc/ >> > I realize for people not used to numpy/scipy might not realize that fftw can > be used in scipy (if it is installed, which it isn't by default due to > licensing). What I meant is for sage this should be turned on by default, also > fftw is what matlab uses, so as it has been said for SVD using lapack, this > would also remove all real differences, outside of how the package is > built/wrapped. > > Gabriel >
When I was trying to do FFT's quickly this summer for a project in Sage, I recall that when I installed the fftw library (easy), then built scipy, then the scipy FFT used fftw and was quite fast. I also noticed, somewhat surprisingly, that even without fftw the scipy fft was faster than numpy's! This is why the code in the finance.TimeSeries in Sage for doing (real) fft's is: w = y.numpy(copy=False) scipy.fftpack.rfft(w, overwrite_x=1) return y -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---