def toeplitz(c, r=None):
 c = np.asarray(c).ravel()
 if (r is None):
  r = c.conjugate()
 else:
  r = np.asarray(r).ravel()
 vals = np.concatenate((r[(-1):0:(-1)], c))
 (a, b) = np.ogrid[0:len(c), (len(r) - 1):(-1):(-1)]
 indx = (a + b)
 return vals[indx]

def toeplitz ( c , r = None ) : c = np . asarray ( c ) . ravel ( ) if ( r is None ) : r = c . conjugate ( ) else : r = np . asarray ( r ) . ravel ( ) vals = np . concatenate ( ( r [ ( - 1 ) : 0 : ( - 1 ) ] , c ) ) ( a , b ) = np . ogrid [ 0 : len ( c ) , ( len ( r ) - 1 ) : ( - 1 ) : ( - 1 ) ] indx = ( a + b ) return vals [ indx ]
construct a toeplitz matrix .