parameters: (freq1, freq2, delta_p, delta_s)
return_statement: return n
docstring: FIR lowpass filter length estimator.  freq1 and freq2 are
      normalized to the sampling frequency.  delta_p is the passband
      deviation (ripple), delta_s is the stopband deviation (ripple).
  
      Note, this works for high pass filters too (freq1 > freq2), but
      doesn't work well if the transition is near f == 0 or f == fs/2
  
      From Herrmann et al (1973), Practical design rules for optimum
      finite impulse response filters.  Bell System Technical J., 52, 769-99
docstring_summary: FIR lowpass filter length estimator.  freq1 and freq2 are
      normalized to the sampling frequency.  delta_p is the passband
      deviation (ripple), delta_s is the stopband deviation (ripple).
docstring_tokens: FIR lowpass filter length estimator . freq1 and freq2 are normalized to the sampling frequency . delta_p is the passband deviation ( ripple ) delta_s is the stopband deviation ( ripple ) .
function: def lporder(freq1, freq2, delta_p, delta_s):
      '''
      FIR lowpass filter length estimator.  freq1 and freq2 are
      normalized to the sampling frequency.  delta_p is the passband
      deviation (ripple), delta_s is the stopband deviation (ripple).
  
      Note, this works for high pass filters too (freq1 > freq2), but
      doesn't work well if the transition is near f == 0 or f == fs/2
  
      From Herrmann et al (1973), Practical design rules for optimum
      finite impulse response filters.  Bell System Technical J., 52, 769-99
      '''
      df = abs(freq2 - freq1)
      ddp = math.log10(delta_p)
      dds = math.log10(delta_s)
  
      a1 = 5.309e-3
      a2 = 7.114e-2
      a3 = -4.761e-1
      a4 = -2.66e-3
      a5 = -5.941e-1
      a6 = -4.278e-1
  
      b1 = 11.01217
      b2 = 0.5124401
  
      t1 = a1 * ddp * ddp
      t2 = a2 * ddp
      t3 = a4 * ddp * ddp
      t4 = a5 * ddp
  
      dinf = ((t1 + t2 + a3) * dds) + (t3 + t4 + a6)
      ff = b1 + b2 * (ddp - dds)
      n = dinf / df - ff * df + 1
      return n
function_tokens: def lporder ( freq1 , freq2 , delta_p , delta_s ) : df = abs ( freq2 - freq1 ) ddp = math . log10 ( delta_p ) dds = math . log10 ( delta_s ) a1 = 5.309e-3 a2 = 7.114e-2 a3 = - 4.761e-1 a4 = - 2.66e-3 a5 = - 5.941e-1 a6 = - 4.278e-1 b1 = 11.01217 b2 = 0.5124401 t1 = a1 * ddp * ddp t2 = a2 * ddp t3 = a4 * ddp * ddp t4 = a5 * ddp dinf = ( ( t1 + t2 + a3 ) * dds ) + ( t3 + t4 + a6 ) ff = b1 + b2 * ( ddp - dds ) n = dinf / df - ff * df + 1 return n