code: def test_homomorphic(self):
      # check that it can recover frequency responses of arbitrary
      # linear-phase filters
  
      # for some cases we can get the actual filter back
      h = [1, -1]
      h_new = minimum_phase(np.convolve(h, h[::-1]))
      assert_allclose(h_new, h, rtol=0.05)
  
      # but in general we only guarantee we get the magnitude back
      rng = np.random.RandomState(0)
      for n in (2, 3, 10, 11, 15, 16, 17, 20, 21, 100, 101):
          h = rng.randn(n)
          h_new = minimum_phase(np.convolve(h, h[::-1]))
          assert_allclose(
              np.abs(np.fft.fft(h_new)),
              np.abs(np.fft.fft(h)),
              rtol=1e-4,
          )
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_allclose, assert_warns
  from pytest import raises
  from scipy.special import sinc
  from scipy.signal import kaiser_beta, kaiser_atten, kaiserord, firwin, firwin2, freqz, remez, firls, minimum_phase
label_desc: Use image node_id 2 for calling the TestMinimumPhase obj's underlying member method code with example usage: obj.test_homomorphic() without return types