'Helper for resampling'

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')
    self._h_trans_flip = _pad_h(h, self._up)
    self._h_trans_flip = np.ascontiguousarray(self._h_trans_flip)
