-
Notifications
You must be signed in to change notification settings - Fork 194
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
Pythran does not recognise fft2 #1095
Comments
Indeed, np.fft.ifft2 has not been implemented at this point... rfft and irfft are though... |
@jeanlaroche thanks. Can I use general complex fft for 1d arrays? |
So far, pythran only has np.fft.rfft and np.fft.irfft, i.e. 1D ffts with real inputs. |
@jeanlaroche I'll happily review your patch for complex number support and/or 2D support :-) You did a great job with irfft and rfft |
ah ah ah ah! Flattery will get you nowhere! :D |
Numpy RFFT is actually good enough for now :)
and
Both work for real and complex inputs with identical results and times to |
Both work for real and complex inputs with identical results and times to
numpy.fft.fft. If you think it's a good idea I can add the 2D support too and
submit it.
This *is* a good idea! Please submit, even in Python form as a followup
of this issue
|
This should be fixed with #1134, at least it now compiles o/ |
for fft2, normally performing two FFT works well, but it is efficient on big data, that's why there are a lot of hacks in FFTW in order to deal differently with the different sizes of matrix or vectors. |
%%pythran
#pythran export normalized_correlation(float64[:,:],float64[:,:],float64)
#pythran export normalized_correlation(float32[:,:],float32[:,:],float32)
import numpy as np
def normalized_correlation(im1,im2):
im1_fft = np.fft.fft2(im1)
im2_fft = np.fft.fft2(im2)
im_mult = np.multiply(im1_fft,np.conj(im2_fft))
return np.fft.ifft2(im_mult)
Gives the error
The text was updated successfully, but these errors were encountered: