def asd(M1, M2):
from scipy.fftpack import fft2<EOL>spectra1 = np.abs(fft2(M1))<EOL>spectra2 = np.abs(fft2(M2))<EOL>return np.linalg.norm(spectra2 - spectra1)<EOL>
Compute a Fourier transform based distance
    between two matrices.

    Inspired from Galiez et al., 2015
    (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4535829/)