I am trying to implement a Chebyshev type I low-pass IIR digital filter in C. I have got the SOS Matrix and scale values from Matlab.
What is the direct equation or algorithm to implement such a filter?
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.Sign up to join this community
okay, this is, or can be, stuff straight outa a textbook. by "SOS", you mean "2nd-order sections"? i usually call those "biquads". maybe that's not the best term for it in the s-plane. i dunno.
anyway, defending on your passband ripple, you should have the resonant frequency and Q for each LPF biquad. you can use those two parameters and get digital biquads directly out of that using the Audio EQ Cookbook. google will find it fast for you.
otherwise convert your Tchebyshev from s-plane to z-plane however you want. the Cookbook uses the bilinear transform, which means every bump or feature in the analog frequency response will have a corresponding bump or feature in the digital frequency response. if you're more interested in matching the impulse response, you would transform H(s) -> H(z) using the Impulse Invariant method.
someone will probably vote me down for not answering the question completely (they've done it in the past). big deel.
I've been using some pretty nice web-based filter design software that solves the whole problem in one go: http://www.micromodeler.com/dsp
It does the filter design, SOS factoring, solves the integer coefficients and spits out the code in C or for several other platforms. It's pretty intuitive and the demo version should give you the C code that you need.
Even if you don't use the generated code directly in your assignment, you can see how it's done it and you can also use their one to check your results.