/*
* N-order LP Butterworth analog filter
* 1
* H (s) * H (-S) = -------------------
* 1 + (-s ^ 2/WC ^ 2) ^ n
*
* Poles:
* PK = WC * (-SK + J * ck), k = 1, 2,..., n/2
*
* 2 * k-1
* Where Sk = sin (--------- * PI)
* 2 * n
*
* 2 * k-1
* Ck = cos (--------- * PI)
* 2 * n
*
* So, (n is odd)
*
* N/2 WC ^ 2
* H (S) = Mul ------------------------
* K = 1 WC ^ 2 + 2 * WC * SK * s + s ^ 2
*
* 1-Z ^-1
* Replace s ----------
* 1 + Z ^-1
*
* So,
* N/2 WC ^ 2*(1 + 2 * Z ^-1 + Z ^-2)
* H (z) = Mul ------------------------------------------------------------
* K = 1 (WC ^ 2 + 2 * WC * SK + 1) + (2 * WC ^ 2-2) * Z ^-1 + (WC ^ 2-2 * WC * SK + 1) * Z ^-2
*
* If n is even,
*
* P0 =-WC
*
* So,
*
* WC n/2 WC ^ 2
* H (S) = -------- * Mul ------------------------
* WC + S k = 1 WC ^ 2 + 2 * WC * SK * s + s ^ 2
*
* And,
*
* WC * (1 + Z ^-1)
* H (z) = ---------------------- * Mul ....
* (WC + 1) + (wc-1) * Z ^-1
*
*
* Note:
* Here wc is not normalized digital frequency but analog frequency
*
* WC = tan (FC * PI), where fc is normalized digital frequency
*/
/** N-th order Chebyshev I analog LPF's transfer function: ** 1 * H (s) = -------------------- * 1 + e ^ 2 * tn ^ 2 (S/WC) ** where E is the ripple factor, WC is the cutoff frequency * and TN () is Nth Order Chebyshev polynomial. ** poles: ** PK = (+-sinh (a) * sin (B) + jcosh (a) * Cos (B )) * WC ** = RP + J * IP ** 1 1 * Where a = --- * arsinh (---), * n e ** Pi 2 * K-1 * B = --- * -------, k = 1, 2 ,... n/2*2 N * * So, * n/2 1 * H (S) = Mul ------------------------------------------ * k = 1 1-(PK + PK ~) /(Pk * PK ~)) * S + s ^ 2/(Pk * PK ~) ** N/2 1 * = Mul ----------------------------------------------- * k = 1 1-(2 * RP)/(RP ^ 2 + IP ^ 2 )) * s + s ^ 2/(RP ^ 2 + IP ^ 2) ** n/2 1 * = Mul ----------------- * k = 1 1 + A1 * s + A2 * s ^ 2 ** where PK have negtive real parts ** 1-Z ^- 1 * replace s with ---------- * 1 + Z ^-1 ** n/2 1 + 2 * Z ^-1 + Z ^-2 * H (z) = Mul ---------------------------------------- * k = 1 (1 + A1 + A2) + (2-2 * A2) * Z ^-1 + (1-a1 + A2) * Z ^-2 *** Note: * WC is analog frequency ;*
*/