0

I am working on a Python program (in Enthought Canopy) that will calculate the two point autocorrelation function for 2 and 3 dimensional images.

The core of the calculation is the following code:

fftx = fftn(newimpad)
del newimpad
ret_int = (fftx * np.conjugate(fftx))
del fftx
ret = ifftn(ret_int)
ret = fftshift(ret)      

where newimpad is the padded image.

This works. However, the back transform (the ifftn step) is very slow - for the large images I have been working on in 2D it takes over 90 seconds. Is there any way to speed this up?

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
LM Anovitz
  • 61
  • 1
  • 5
  • Is your matrix conjugate symmetric? (Or more importantly, is it *nearly* symmetric?) If so you can add `"symmetric"` as an argument to `ifftn` to speed it up. – will Sep 10 '14 at 13:48
  • the original data is an 8-bit binary image of pore space in a solid matrix. it may or may not be isotropic. I do not know if the fft generated is a symmetric matrix. – LM Anovitz Sep 10 '14 at 14:09

0 Answers0