Skip to content

Instantly share code, notes, and snippets.

@RodolfoFerro
Created May 31, 2017 06:26
Show Gist options
  • Save RodolfoFerro/5f0124d6babeec8cac9a7bb2e8537c2f to your computer and use it in GitHub Desktop.
Save RodolfoFerro/5f0124d6babeec8cac9a7bb2e8537c2f to your computer and use it in GitHub Desktop.
2D - DFT: 2D - Discrete Fourier Transform
# 2 Dimension Fourier Transform:
def FT_2D(X):
m, n = X.shape
return np.array([ [ sum([ sum([ X[i,j]*np.exp(-1j*2*np.pi*(k_m*i/m + k_n*j/n)) for i in range(m) ]) for j in range(n) ]) for k_n in range(n) ] for k_m in range(m) ])
@ZijinNie
Copy link

ZijinNie commented Apr 2, 2020

unreadable

@Hamed2Hamed
Copy link

can you provide the full code that takes an image as an input, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment