Last active
March 31, 2020 09:19
-
-
Save marmakoide/d8925a5ed149ce83f37ddb41c38edd8b to your computer and use it in GitHub Desktop.
Rotation of 2d DFT coefficients, avoiding computing a DFT by directly transforming the DFT coefficients
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
def rot180_fft_2d(X, N): | |
I = numpy.repeat([numpy.arange(N)], N, axis = 0) | |
K = numpy.exp((2 * numpy.pi / N) * (I + I.T) * 1j) | |
return K * numpy.conj(X) | |
def rot180_rfft_2d(X, N): | |
I = numpy.repeat([numpy.arange(N)], N, axis = 0) | |
K = numpy.exp((2 * numpy.pi / N) * (I + I.T) * 1j)[:,:N // 2 + 1] | |
return K * numpy.conj(X) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment