code: def asd(M1, M2):
      
  
      from scipy.fftpack import fft2
      spectra1 = np.abs(fft2(M1))
      spectra2 = np.abs(fft2(M2))
  
      return np.linalg.norm(spectra2 - spectra1)
docs: Compute a Fourier transform based distance
      between two matrices.
  
      Inspired from Galiez et al., 2015
      (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4535829/)