public static int estimateBandPassOrder(int sampleRate,int passBandStart,int passBandEnd,double passBandRippleDb,double stopBandRippleDb){
  double df=(double)Math.abs(passBandEnd - passBandStart) / (double)sampleRate;
  double ddp=(double)Math.log10(passBandRippleDb);
  double dds=(double)Math.log10(stopBandRippleDb);
  double a1=0.01201;
  double a2=0.09664;
  double a3=-0.51325;
  double a4=0.00203;
  double a5=-0.57054;
  double a6=-0.44314;
  double t1=a1 * ddp * ddp;
  double t2=a2 * ddp;
  double t3=a4 * ddp * ddp;
  double t4=a5 * ddp;
  double cinf=dds * (t1 + t2 + a3) + t3 + t4 + a6;
  double ginf=-14.6f * (double)Math.log10(passBandRippleDb / stopBandRippleDb) - 16.9;
  double n=cinf / df + ginf * df + 1.0;
  return (int)Math.ceil(n);
}

public static int estimateBandPassOrder ( int sampleRate , int passBandStart , int passBandEnd , double passBandRippleDb , double stopBandRippleDb ) { double df = ( double ) Math . abs ( passBandEnd - passBandStart ) / ( double ) sampleRate ; double ddp = ( double ) Math . log10 ( passBandRippleDb ) ; double dds = ( double ) Math . log10 ( stopBandRippleDb ) ; double a1 = 0.01201 ; double a2 = 0.09664 ; double a3 = - 0.51325 ; double a4 = 0.00203 ; double a5 = - 0.57054 ; double a6 = - 0.44314 ; double t1 = a1 * ddp * ddp ; double t2 = a2 * ddp ; double t3 = a4 * ddp * ddp ; double t4 = a5 * ddp ; double cinf = dds * ( t1 + t2 + a3 ) + t3 + t4 + a6 ; double ginf = - 14.6f * ( double ) Math . log10 ( passBandRippleDb / stopBandRippleDb ) - 16.9 ; double n = cinf / df + ginf * df + 1.0 ; return ( int ) Math . ceil ( n ) ; }
estimates band pass filter length ;
