parameters: (self, h, x_dtype, up, down)
docstring: Helper for resampling
docstring_summary: Helper for resampling
docstring_tokens: Helper for resampling
function: def __init__(self, h, x_dtype, up, down):
          """Helper for resampling"""
          h = np.asarray(h)
          if h.ndim != 1 or h.size == 0:
              raise ValueError('h must be 1D with non-zero length')
          self._output_type = np.result_type(h.dtype, x_dtype, np.float32)
          h = np.asarray(h, self._output_type)
          self._up = int(up)
          self._down = int(down)
          if self._up < 1 or self._down < 1:
              raise ValueError('Both up and down must be >= 1')
          # This both transposes, and "flips" each phase for filtering
          self._h_trans_flip = _pad_h(h, self._up)
          self._h_trans_flip = np.ascontiguousarray(self._h_trans_flip)
function_tokens: def __init__ ( self , h , x_dtype , up , down ) : h = np . asarray ( h ) if h . ndim != 1 or h . size == 0 : raise ValueError ( 'h must be 1D with non-zero length' ) self . _output_type = np . result_type ( h . dtype , x_dtype , np . float32 ) h = np . asarray ( h , self . _output_type ) self . _up = int ( up ) self . _down = int ( down ) if self . _up < 1 or self . _down < 1 : raise ValueError ( 'Both up and down must be >= 1' ) # This both transposes, and "flips" each phase for filtering self . _h_trans_flip = _pad_h ( h , self . _up ) self . _h_trans_flip = np . ascontiguousarray ( self . _h_trans_flip )