| Total Complexity | 2 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import numpy as np |
||
| 2 | |||
| 3 | |||
| 4 | class FourierTransform: |
||
| 5 | |||
| 6 | @staticmethod |
||
| 7 | def fourier_transform(array: np.ndarray) -> np.ndarray: |
||
| 8 | transformed = np.fft.fftn(array) |
||
| 9 | fshift = np.fft.fftshift(transformed) |
||
| 10 | return fshift |
||
| 11 | |||
| 12 | @staticmethod |
||
| 13 | def inv_fourier_transform(fshift: np.ndarray) -> np.ndarray: |
||
| 14 | f_ishift = np.fft.ifftshift(fshift) |
||
| 15 | img_back = np.fft.ifftn(f_ishift) |
||
| 16 | return img_back |
||
| 17 |