-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement fft and related functions #60
Comments
How does this look: http://sourceforge.net/projects/kissfft/ Or is FFTPACK the kind of code that's really hard to beat? |
My understanding is that FFTW is the kind of code that's hard to beat, but I suspect Viral and others know much more about it than I do. |
FFTPACK is an old well known code that many projects use. I don't think it is particularly fast or anything. It may also be possible to write a useful fft in julia, as a placeholder until we get fftw. If kissfft is not used by at least a few projects, we will end up becoming beta testers. -viral On Jun 19, 2011, at 2:01 AM, JeffBezanson wrote:
|
I just pushed bc774de which lets you download, compile and setup FFTW. Haven't tried actually using it yet, but it's a start. |
From the manual, this is what the code looks like. So, either, we need to write a simple thin wrapper that is callable from julia, or wait until julia can support a more general C FFI. Another benefit of FFTW could be that we can use their matrix transpose routines too, which are quite fast.
-viral |
Coming to think of it, we can just use the Fortran calling interface, and get fftw to work immediately. http://fftw.org/fftw3_doc/Calling-FFTW-from-Fortran.html#Calling-FFTW-from-Fortran -viral On Jun 19, 2011, at 4:31 AM, StefanKarpinski wrote:
|
I don't get why we can't use the C interface. Because of the data layout or because of the plan bit? The data layout is actually not a problem since |
How do we create all the structs that fftw defines in fftw.h in julia and pass them through the C interface? If we can, then we can use the C interface - but I always thought this was not possible. -viral On Jun 19, 2011, at 5:14 AM, StefanKarpinski wrote:
|
The only reason to use the fortran interface is that it is likely to be free of passing the C structs around. -viral On Jun 19, 2011, at 5:14 AM, StefanKarpinski wrote:
|
Well, seems like I can just treat all fftw data structures as void * and pass them around. Keeping this bug open until we implement most of the fft related functions - FFT2, FFTN, FFTSHIFT, IFFT, IFFT2, IFFTN.. We probably also need to do some saving of the plans and such. julia> x = complex(ones(8),ones(8)) julia> fft(x) |
Excellent! |
Good catch - fixed. Commit 021afbf also makes includes fft in the regular julia build and startup. |
This is awesome. Just what I hoped might happen if I setup the download and compilation bit :-) |
Yes - I wouldn't have gone through all this just to try out and see if it would work. However, with your download and compile done, I found myself sitting on a plane, and thought, what the heck, let's try it out. -viral On Jun 22, 2011, at 12:37 PM, StefanKarpinski wrote:
|
Excellent :-D |
Discussion on subarray relevant here, for ability to compute fft on slices of arrays. http://groups.google.com/group/julia-math/browse_thread/thread/f07b1f6047d98a8c/ |
Good discussion on real valued FFT, and general stuff - including posts by Steve Johnson: http://www.mathworks.com/matlabcentral/newsreader/view_thread/39968 |
Yeah, that is an awesome thread. Gives a lot of faith in the quality of the FFTW implementation. Glad we're using it :-) |
Fixes #60 (unless there are strong objections)
* implement "garbage collection"
We need fft before launch. I assume FFTW is the only realistic library we can use. If it is too much of a pain to integrate until our full C FFI is ready, we can go with FFTPACK.
The text was updated successfully, but these errors were encountered: