### Question:
FilterCoefficients { protected void transformLowpassToBandpass(double w0, double bw) throws BadFilterParametersException { int D = aCoefficients.length - 1; int N = bCoefficients.length - 1; int ma = Math.max(D,N); int Np = N + ma; int Dp = D + ma; double[] bprime = new double[Np + 1]; double[] aprime = new double[Dp + 1]; double value; int i, j, k; for (j = 0; j <= Np; j++) { value = 0.0; for (i = 0; i <= N; i++) for (k = 0; k <= i; k++) if (ma - i + 2 * k == j) value += SpecialMath.combinations(i, k) * bCoefficients[N - i] * Math.pow(w0 * w0, i - k) / Math.pow(bw, i); bprime[Np - j] = value; } for (j = 0; j <= Dp; j++) { value = 0.0; for (i = 0; i <= D; i++) for (k = 0; k <= i; k++) if (ma - i + 2 * k == j) value += SpecialMath.combinations(i, k) * aCoefficients[D - i] * Math.pow(w0 * w0, i - k) / Math.pow(bw, i); aprime[Dp - j] = value; } aCoefficients = aprime; bCoefficients = bprime; normalize(); } FilterCoefficients(double[] bCoefficients, double[] aCoefficients); int getFilterOrder(); int getNumberOfCoefficients(); double[] getACoefficients(); double[] getBCoefficients(); @Override boolean equals(Object o); @Override int hashCode(); void print(); @Override String toString();  }### Answer:
@Test public void testTransformLowpassToBandpass() throws BadFilterParametersException { double[] b = new double[] {0.06264858}; double[] a = new double[] {1.00000000, 0.57450003, 1.41502514, 0.54893711, 0.40796631, 0.06264858 }; FilterCoefficients coeffs = new FilterCoefficients(b, a); double[] pythonB = new double[] {2.00475456, 0, 0, 0, 0, 0}; double[] pythonA = new double[] { 1.00000000e+00, 1.14900006e+00, 5.06601006e+01, 4.57554990e+01, 9.69350176e+02, 6.39465728e+02, 8.72415158e+03, 3.70619542e+03, 3.69312133e+04, 7.53858939e+03, 5.90490000e+04 }; coeffs.transformLowpassToBandpass(3.0, 2.0); assertEquals(new FilterCoefficients(pythonB, pythonA), coeffs, 1e-5); }