parameters: (b, a, fs=1.0)
return_statement: return normalize(bprime, aprime)
docstring: Return a digital filter from an analog one using a bilinear transform.
  
      The bilinear transform substitutes ``(z-1) / (z+1)`` for ``s``.
docstring_summary: Return a digital filter from an analog one using a bilinear transform.
docstring_tokens: Return a digital filter from an analog one using a bilinear transform .
function: def bilinear(b, a, fs=1.0):
      """Return a digital filter from an analog one using a bilinear transform.
  
      The bilinear transform substitutes ``(z-1) / (z+1)`` for ``s``.
      """
      fs = float(fs)
      a, b = map(atleast_1d, (a, b))
      D = len(a) - 1
      N = len(b) - 1
      artype = float
      M = max([N, D])
      Np = M
      Dp = M
      bprime = numpy.zeros(Np + 1, artype)
      aprime = numpy.zeros(Dp + 1, artype)
      for j in range(Np + 1):
          val = 0.0
          for i in range(N + 1):
              for k in range(i + 1):
                  for l in range(M - i + 1):
                      if k + l == j:
                          val += (comb(i, k) * comb(M - i, l) * b[N - i] *
                                  pow(2 * fs, i) * (-1) ** k)
          bprime[j] = real(val)
      for j in range(Dp + 1):
          val = 0.0
          for i in range(D + 1):
              for k in range(i + 1):
                  for l in range(M - i + 1):
                      if k + l == j:
                          val += (comb(i, k) * comb(M - i, l) * a[D - i] *
                                  pow(2 * fs, i) * (-1) ** k)
          aprime[j] = real(val)
  
      return normalize(bprime, aprime)
function_tokens: def bilinear ( b , a , fs = 1.0 ) : fs = float ( fs ) a , b = map ( atleast_1d , ( a , b ) ) D = len ( a ) - 1 N = len ( b ) - 1 artype = float M = max ( [ N , D ] ) Np = M Dp = M bprime = numpy . zeros ( Np + 1 , artype ) aprime = numpy . zeros ( Dp + 1 , artype ) for j in range ( Np + 1 ) : val = 0.0 for i in range ( N + 1 ) : for k in range ( i + 1 ) : for l in range ( M - i + 1 ) : if k + l == j : val += ( comb ( i , k ) * comb ( M - i , l ) * b [ N - i ] * pow ( 2 * fs , i ) * ( - 1 ) ** k ) bprime [ j ] = real ( val ) for j in range ( Dp + 1 ) : val = 0.0 for i in range ( D + 1 ) : for k in range ( i + 1 ) : for l in range ( M - i + 1 ) : if k + l == j : val += ( comb ( i , k ) * comb ( M - i , l ) * a [ D - i ] * pow ( 2 * fs , i ) * ( - 1 ) ** k ) aprime [ j ] = real ( val ) return normalize ( bprime , aprime )