double prod = omega1*omega2;
double[] tn = { prod, 0.0, 1.0 };
double[] td = { 0.0, BW };
Rational T = new Rational( tn, td );
AnalogPrototype retval = new AnalogPrototype();
double A = 1.0;
for ( int i = 0; i < sections.size(); i++ ) {
Rational section = sections.get(i);
Rational Tsection = section.map( T );
A *= Tsection.canonicalForm();
int[] order = section.order();
if ( order[0] < 2 && order[1] < 2 ) retval.addSection( Tsection );
else if ( order[1] == 2 ) {
Polynomial[] DT = lptobpFactors( section.denominator(), BW, prod );
double[] t1 = { 0.0, 1.0 };
if ( order[0] == 0 ) {
retval.addSection( new Rational( new Polynomial(t1), DT[0] ) );
retval.addSection( new Rational( new Polynomial(t1), DT[1] ) );
}
else if ( order[0] == 1 ) {
retval.addSection( new Rational( new Polynomial(t1), DT[0] ) );
double[] t2 = new double[3];
double[] tc = Tsection.numerator().coefficients();
for ( int j = 0; j < 3; j++ ) t2[j] = tc[j+1];
retval.addSection( new Rational( new Polynomial(t2), DT[1] ) );
}
else if ( order[0] == 2 ) {
Polynomial[] NT = lptobpFactors( section.numerator(), BW, prod );
retval.addSection( new Rational( NT[0], DT[0] ) );
retval.addSection( new Rational( NT[1], DT[1] ) );
}
}
}