secondorder IIR filter coefficients
Jan 05 2017  12:02 pm
Hello all,
I came across this nice paper by Themis Katsianos
http://fc.mbs.net/~pfisher/fov20010016c/fov20010016e/fov2001001a3/chapters/25katsianos/index.html
I implemented the last examples with Chebyshev response.
Firstly, it uses a secondorder IIR filter, easy to implement with gen~
secondOrderIIR (x, a0, a1, a2, b1, b2)
{
History x1, x2, y1, y2;
y = a0 * x + a1 * x1 + a2 * x2  b1 * y1  b2 * y2;
y2 = y1;
y1 = y;
x2 = x1;
x1 = x;
return (y);
}
Then it's possible to produce a wide range of filter types.
All we need is to give it the right coefficients to these feedback loops.
It's possible to cascade these filters to produce higher order.
The bandpass coefficients work great. The example is for 1dB ripple
chebychevBandPass (center, bandwidth)
{
ripple = 1.965267;
bandfreq = PI * bandwidth / samplerate;
// tan is slower
var = cos (bandfreq) / sin (bandfreq);
// to avoid calculate this sum more than one time
var2 = ripple + var;
scale = 2 * cos (TWOPI * center / samplerate);
a0 = ripple / (var2);
a1 = 0;
a2 = a0;
b1 = var * scale / var2;
b2 = (var  ripple) / var2;
return a0, a1, a2, b1, b2;
}
Then I tried the bandstop coefficients generator with no success, all it outputs is 10000...
chebychevBandStop (center, bandwidth)
{
ripple = 1.965267;
bandfreq = PI * bandwidth / samplerate;
// tan is slower
var = cos (bandfreq) / sin (bandfreq);
// to avoid calculate this sum more than one time
var2 = ripple + var;
scale = 2 * cos (TWOPI * center / samplerate);
a0 = ripple / (var2);
a1 = ripple * scale / var2;
a2 = a0;
b1 = var * scale / var2;
b2 = (ripple  var) / var2;
return a0, a1, a2, b1, b2;
}
So, if anyone has the right coefficients for Bandstop, lowpass and highpass, I'd be grateful.
Here is a patch to listen to a fourthorder chebyshev bandpass filter.

I did the same researches for FIR filters and found butterworth lowpass and highs coefficients.
I'm looking after inversechebyshev, elliptic, bessel coefficients too.
Here is a page on the advantages and disadvantages of all these types of filters
http://www.etc.tuiasi.ro/cin/Downloads/Filters/Filters.htm#Butt
Thank you everyone.