Source code for pysdkit.utils._fft
import numpy as np
from numpy import fft as f
[docs]
def fft(ts: np.ndarray) -> np.ndarray:
"""Fast Fourier Transform"""
return f.fft(ts)
[docs]
def ifft(ts: np.ndarray) -> np.ndarray:
"""Inverse Fast Fourier Transform"""
return f.ifft(ts)
[docs]
def fft2d(img: np.ndarray) -> np.ndarray:
"""Fast Fourier Transform for 2D Images"""
return f.fft2(img)
[docs]
def ifft2d(img: np.ndarray) -> np.ndarray:
"""Inverse Fast Fourier Transform for 2D Images"""
return f.ifft2(img)
[docs]
def fftshift(ts: np.ndarray) -> np.ndarray:
"""Fast Fourier Transform Shift"""
return f.fftshift(ts)
[docs]
def ifftshift(ts: np.ndarray) -> np.ndarray:
"""Inverse Fast Fourier Transform"""
return f.ifftshift(ts)