code: def test_hilbert(self):
      N = 11  # number of taps in the filter
      a = 0.1  # width of the transition band
  
      # design an unity gain hilbert bandpass filter from w to 0.5-w
      h = remez(11, [a, 0.5 - a], [1], type="hilbert")
  
      # make sure the filter has correct # of taps
      assert_(len(h) == N, "Number of Taps")
  
      # make sure it is type III (anti-symmetric tap coefficients)
      assert_array_almost_equal(
          h[: (N - 1) // 2], -h[: -(N - 1) // 2 - 1 : -1]
      )
  
      # Since the requested response is symmetric, all even coefficients
      # should be zero (or in this case really small)
      assert_(
          (abs(h[1::2]) < 1e-15).all(), "Even Coefficients Equal Zero"
      )
  
      # now check the frequency response
      w, H = freqz(h, 1)
      f = w / 2 / np.pi
      Hmag = abs(H)
  
      # should have a zero at 0 and pi (in this case close to zero)
      assert_((Hmag[[0, -1]] < 0.02).all(), "Zero at zero and pi")
  
      # check that the pass band is close to unity
      idx = np.logical_and(f > a, f < 0.5 - a)
      assert_(
          (abs(Hmag[idx] - 1) < 0.015).all(), "Pass Band Close To Unity"
      )
  
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 TestRemez obj's underlying member method code with example usage: obj.test_hilbert() without return types