def upfirdn_naive(x, h, up=1, down=1):
 h = np.asarray(h)
 out = np.zeros((len(x) * up), x.dtype)
 out[::up] = x
 out = np.convolve(h, out)[::down][:_output_len(len(h), len(x), up, down)]
 return out

def upfirdn_naive ( x , h , up = 1 , down = 1 ) : h = np . asarray ( h ) out = np . zeros ( ( len ( x ) * up ) , x . dtype ) out [ : : up ] = x out = np . convolve ( h , out ) [ : : down ] [ : _output_len ( len ( h ) , len ( x ) , up , down ) ] return out
naive upfirdn processing in python note: arg order differs to facilitate apply_along_axis use .