def test_ihfft(self): x = random(14) + 1j * random(14) x_herm = np.concatenate((random(1), x, random(1))) x = np.concatenate((x_herm, x[::-1].conj())) assert_array_almost_equal(x_herm, fft.ihfft(fft.hfft(x_herm))) assert_array_almost_equal( x_herm, fft.ihfft(fft.hfft(x_herm, norm="ortho"), norm="ortho"))
def test_ihfft(self): x = random(14) + 1j * random(14) x_herm = np.concatenate((random(1), x, random(1))) x = np.concatenate((x_herm, x[::-1].conj())) assert_array_almost_equal(x_herm, fft.ihfft(fft.hfft(x_herm))) for norm in ["backward", "ortho", "forward"]: assert_array_almost_equal( x_herm, fft.ihfft(fft.hfft(x_herm, norm=norm), norm=norm))
def test_dtypes(self, dtype): # make sure that all input precisions are accepted x = random(30).astype(dtype) assert_array_almost_equal(fft.ifft(fft.fft(x)), x) assert_array_almost_equal(fft.irfft(fft.rfft(x)), x) assert_array_almost_equal(fft.hfft(fft.ihfft(x), len(x)), x)