def lp2hp(b, a, wo=1.0):
 (a, b) = map(atleast_1d, (a, b))
 try:
  wo = float(wo)
 except TypeError:
  wo = float(wo[0])
 d = len(a)
 n = len(b)
 if (wo != 1):
  pwo = pow(wo, numpy.arange(max((d, n))))
 else:
  pwo = numpy.ones(max((d, n)), b.dtype.char)
 if (d >= n):
  outa = (a[::(-1)] * pwo)
  outb = resize(b, (d,))
  outb[n:] = 0.0
  outb[:n] = (b[::(-1)] * pwo[:n])
 else:
  outb = (b[::(-1)] * pwo)
  outa = resize(a, (n,))
  outa[d:] = 0.0
  outa[:d] = (a[::(-1)] * pwo[:d])
 return normalize(outb, outa)

def lp2hp ( b , a , wo = 1.0 ) : ( a , b ) = map ( atleast_1d , ( a , b ) ) try : wo = float ( wo ) except TypeError : wo = float ( wo [ 0 ] ) d = len ( a ) n = len ( b ) if ( wo != 1 ) : pwo = pow ( wo , numpy . arange ( max ( ( d , n ) ) ) ) else : pwo = numpy . ones ( max ( ( d , n ) ) , b . dtype . char ) if ( d >= n ) : outa = ( a [ : : ( - 1 ) ] * pwo ) outb = resize ( b , ( d , ) ) outb [ n : ] = 0.0 outb [ : n ] = ( b [ : : ( - 1 ) ] * pwo [ : n ] ) else : outb = ( b [ : : ( - 1 ) ] * pwo ) outa = resize ( a , ( n , ) ) outa [ d : ] = 0.0 outa [ : d ] = ( a [ : : ( - 1 ) ] * pwo [ : d ] ) return normalize ( outb , outa )
transform a lowpass filter prototype to a highpass filter .