def bandpass_order(f_stop1, f_pass1, f_pass2, f_stop2, dpass_dB, dstop_dB, fsamp = <NUM_LIT:1>):
dpass = <NUM_LIT:1> - <NUM_LIT:10>**(-dpass_dB/<NUM_LIT:20>)<EOL>dstop = <NUM_LIT:10>**(-dstop_dB/<NUM_LIT:20>)<EOL>Df1 = (f_pass1 - f_stop1)/fsamp<EOL>Df2 = (f_stop2 - f_pass2)/fsamp<EOL>b1 = <NUM_LIT><EOL>b2 = <NUM_LIT><EOL>b3 = -<NUM_LIT><EOL>b4 = <NUM_LIT><EOL>b5 = -<NUM_LIT><EOL>b6 = -<NUM_LIT><EOL>Df = min(Df1, Df2)<EOL>Cinf = np.log10(dstop)*(b1*np.log10(dpass)**<NUM_LIT:2> + b2*np.log10(dpass) + b3)+ (b4*np.log10(dpass)**<NUM_LIT:2> + b5*np.log10(dpass) + b6)<EOL>g = -<NUM_LIT>*np.log10(dpass/dstop) - <NUM_LIT><EOL>N = Cinf/Df + g*Df + <NUM_LIT:1><EOL>ff = <NUM_LIT:2>*np.array([<NUM_LIT:0>, f_stop1, f_pass1, f_pass2, f_stop2, fsamp/<NUM_LIT:2>])/fsamp<EOL>aa = np.array([<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:1>, <NUM_LIT:0>, <NUM_LIT:0>])<EOL>wts = np.array([dpass/dstop, <NUM_LIT:1>, dpass/dstop])<EOL>return int(N), ff, aa, wts<EOL>
Optimal FIR (equal ripple) Bandpass Order Determination

Text reference: Ifeachor, Digital Signal Processing a Practical Approach, 
second edition, Prentice Hall, 2002.
Journal paper reference: F. Mintzer & B. Liu, Practical Design Rules for Optimum
FIR Bandpass Digital Filters, IEEE Transactions on Acoustics and Speech, pp. 
204-206, April,1979.