def test_ifft_shift_execution(setup): t = fftfreq(9, d=1. / 9, chunk_size=4).reshape(3, 3) r = ifftshift(t) res = r.execute().fetch() expected = np.fft.ifftshift(np.fft.fftfreq(9, d=1. / 9).reshape(3, 3)) np.testing.assert_allclose(res, expected)
def testIFFTShiftExecution(self): t = fftfreq(9, d=1. / 9, chunk_size=2).reshape(3, 3) r = ifftshift(t) res = self.executor.execute_tensor(r, concat=True)[0] expected = np.fft.ifftshift(np.fft.fftfreq(9, d=1. / 9).reshape(3, 3)) np.testing.assert_allclose(res, expected)
def test_fft_shift(): freqs = fftfreq(9, d=1. / 9).reshape(3, 3) t = ifftshift(fftshift(freqs)) assert t.dtype is not None expect_dtype = np.fft.ifftshift(np.fft.fftshift(np.fft.fftfreq(9, d=1. / 9).reshape(3, 3))).dtype assert t.dtype == expect_dtype
def testFFTShift(self): freqs = fftfreq(9, d=1. / 9).reshape(3, 3) t = ifftshift(fftshift(freqs)) self.assertIsNotNone(t.dtype) expect_dtype = np.fft.ifftshift( np.fft.fftshift(np.fft.fftfreq(9, d=1. / 9).reshape(3, 3))).dtype self.assertEqual(t.dtype, expect_dtype)