Пример #1
0
 def test_ihfft2(self):
     x = random((30, 20))
     expect = fft.ifft2(x)[:, :11]
     assert_array_almost_equal(expect, fft.ihfft2(x))
     assert_array_almost_equal(expect, fft.ihfft2(x, norm="backward"))
     assert_array_almost_equal(expect * np.sqrt(30 * 20),
                               fft.ihfft2(x, norm="ortho"))
     assert_array_almost_equal(expect * (30 * 20),
                               fft.ihfft2(x, norm="forward"))
Пример #2
0
 def test_ihfft2(self):
     x = random((30, 20))
     assert_array_almost_equal(fft.ifft2(x)[:, :11], fft.ihfft2(x))
     assert_array_almost_equal(fft.ihfft2(x) * np.sqrt(30 * 20),
                               fft.ihfft2(x, norm="ortho"))
Пример #3
0
 def test_hfft2(self):
     x = random((30, 20))
     assert_array_almost_equal(x, fft.hfft2(fft.ihfft2(x)))
     assert_array_almost_equal(
         x, fft.hfft2(fft.ihfft2(x, norm="ortho"), norm="ortho"))
Пример #4
0
 def test_hfft2(self):
     x = random((30, 20))
     assert_array_almost_equal(x, fft.hfft2(fft.ihfft2(x)))
     for norm in ["backward", "ortho", "forward"]:
         assert_array_almost_equal(
             x, fft.hfft2(fft.ihfft2(x, norm=norm), norm=norm))