[Spuc-users] Mathematics
Brought to you by:
spuc
|
From: artem r. <art...@gm...> - 2012-09-11 16:02:28
|
Hello.
I am investigating butterworth filter and found some unclear mathematics.
Following function is bilinear transformation, usially, as result, we
must get coefficients a0 a1 ... b0 b1
But in this case it loks like we got tranformated roots
May be someone can explain me how following works ?
td = a*a - 2*a*roots[j].real() + magsq(roots[j]);
roots[j] = complex<double>((a*a - magsq(roots[j])),
2.0*a*roots[j].imag())/td;
//! Do bilinear transformation
void bilinear(long n2) {
double td;
int j;
const double a = 2.;
if (odd) {
// For s-domain zero (or pole) at infinity we
// get z-domain zero (or pole) at z = -1
double tmp = (roots[0].real()-a)/(a+roots[0].real());
iir_1->set_coeff(-tmp);
gain *= 0.5*(1+tmp);
}
for (j=odd;j<n2;j++) {
td = a*a - 2*a*roots[j].real() + magsq(roots[j]);
roots[j] = complex<double>((a*a - magsq(roots[j])),
2.0*a*roots[j].imag())/td;
}
}
|