Esempio n. 1
0
 def test_ihfftn(self):
     x = random((30, 20, 10))
     expect = fft.ifftn(x)[:, :, :6]
     assert_array_almost_equal(expect, fft.ihfftn(x))
     assert_array_almost_equal(expect, fft.ihfftn(x, norm="backward"))
     assert_array_almost_equal(expect * np.sqrt(30 * 20 * 10),
                               fft.ihfftn(x, norm="ortho"))
     assert_array_almost_equal(expect * (30 * 20 * 10),
                               fft.ihfftn(x, norm="forward"))
Esempio n. 2
0
 def test_ihfftn(self):
     x = random((30, 20, 10))
     assert_array_almost_equal(fft.ifftn(x)[:, :, :6], fft.ihfftn(x))
     assert_array_almost_equal(fft.ihfftn(x) * np.sqrt(30 * 20 * 10),
                               fft.ihfftn(x, norm="ortho"))
Esempio n. 3
0
 def test_hfftn(self):
     x = random((30, 20, 10))
     assert_array_almost_equal(x, fft.hfftn(fft.ihfftn(x)))
     assert_array_almost_equal(
         x, fft.hfftn(fft.ihfftn(x, norm="ortho"), norm="ortho"))
Esempio n. 4
0
 def test_hfftn(self):
     x = random((30, 20, 10))
     assert_array_almost_equal(x, fft.hfftn(fft.ihfftn(x)))
     for norm in ["backward", "ortho", "forward"]:
         assert_array_almost_equal(
             x, fft.hfftn(fft.ihfftn(x, norm=norm), norm=norm))