def deconvolve(signal, divisor):
 num = atleast_1d(signal)
 den = atleast_1d(divisor)
 N = len(num)
 D = len(den)
 if (D > N):
  quot = []
  rem = num
 else:
  input = ones(((N - D) + 1), float)
  input[1:] = 0
  quot = lfilter(num, den, input)
  rem = (num - convolve(den, quot, mode='full'))
 return (quot, rem)

def deconvolve ( signal , divisor ) : num = atleast_1d ( signal ) den = atleast_1d ( divisor ) N = len ( num ) D = len ( den ) if ( D > N ) : quot = [ ] rem = num else : input = ones ( ( ( N - D ) + 1 ) , float ) input [ 1 : ] = 0 quot = lfilter ( num , den , input ) rem = ( num - convolve ( den , quot , mode = 'full' ) ) return ( quot , rem )
deconvolves divisor out of signal .