msaf/algorithms/fmc2d/utils_2dfmc.py
def compute_ffmc2d(X):
    """Computes the 2D-Fourier Magnitude Coefficients."""
    # 2d-fft
    fft2 = scipy.fftpack.fft2(X)

    # Magnitude
    fft2m = magnitude(fft2)

    # FFTshift and flatten
    fftshift = scipy.fftpack.fftshift(fft2m).flatten()

    #cmap = plt.cm.get_cmap('hot')
    #plt.imshow(np.log1p(scipy.fftpack.fftshift(fft2m)).T, interpolation="nearest",
    #    aspect="auto", cmap=cmap)
    #plt.show()

    # Take out redundant components
    return fftshift[:fftshift.shape[0] // 2 + 1]
def compute_ffmc2d(X):
    # 2d-fft
    fft2 = scipy.fftpack.fft2(X)

    # Magnitude
    fft2m = magnitude(fft2)

    # FFTshift and flatten
    fftshift = scipy.fftpack.fftshift(fft2m).flatten()

    #cmap = plt.cm.get_cmap('hot')
    #plt.imshow(np.log1p(scipy.fftpack.fftshift(fft2m)).T, interpolation="nearest",
    #    aspect="auto", cmap=cmap)
    #plt.show()

    # Take out redundant components
    return fftshift[:fftshift.shape[0] // 2 + 1]
def compute_ffmc2d ( X ) : # 2d-fft fft2 = scipy . fftpack . fft2 ( X ) # Magnitude fft2m = magnitude ( fft2 ) # FFTshift and flatten fftshift = scipy . fftpack . fftshift ( fft2m ) . flatten ( ) #cmap = plt.cm.get_cmap('hot') #plt.imshow(np.log1p(scipy.fftpack.fftshift(fft2m)).T, interpolation="nearest", #    aspect="auto", cmap=cmap) #plt.show() # Take out redundant components return fftshift [ : fftshift . shape [ 0 ] // 2 + 1 ]
Computes the 2D-Fourier Magnitude Coefficients.
Computes the 2D - Fourier Magnitude Coefficients .