Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I already posted this question on StackOverflow. I got a suggestion to go for a better answer here.

To make the question more concise I'm interested in an introduction to digital filters, any resource is good.

But first I will be satisfied if someone could point me to some resources explaining this filter (used in Android):

http://gitorious.org/rowboat/frameworks-base/blobs/671a6ff4be11b3e2d8eb017e0c7a78e6133fb2b8/services/sensorservice/SecondOrderLowPassFilter.cpp

What I'm interested is the way the filter's parameters are chosen. While I can copy it without thinking, I guess I should understand the basic concept/idea behind before using it.

Thanks,

Iulian

share|improve this question

3 Answers 3

up vote 11 down vote accepted

You can derive the expression for the coefficients by doing bilinear transformation of the following analog low-pass prototype filter

$$H(s) = \frac{w_0^2}{s^2 + (w_0/Q)s + w_0^2}$$

where $w_0$ is the cut-off frequency.

You can lookup the bilinear transformation on Wikipedia.

The filter used in the Android app is a Butterworth filter because the chosen value of Q is $1/\sqrt{2}$. Note that in the constructor the inverse of Q is computed and assigned to variable iQ which is used in the computation of the coefficients. Note also that the variable K holds the 'frequency-warped' value of the specified cut-off frequency. You can find more information about the frequency-warping phenomenon in the above link.

You can find many examples on digital filter design using bilinear transformation. I found this one, which is quite close to the Android example.

share|improve this answer
    
Thank you. I start remembering math I did in college; unfortunately no one was there to show me also a good practical example or I was concerned with something else... –  Iulian Şerbănoiu Sep 16 '11 at 10:49

A really good and thorough introduction to digital filters is https://ccrma.stanford.edu/~jos/filters/filters.html . Your particularly example is a very simple 2nd or 4th order low pass filter. If you use the "Biquad" object you would get a second order Butterworth filter. If you use the "CascadedBiquad" object you would get what's called a 4th order Linkwitz Riley filter (but NOT a 4th order Butterworth). The implementation is fairly specific. With a little more work you can do something that is much more generic and usable for all applications.

share|improve this answer
    
Yes, I really want to understand the filter theory so I can control the filters I'm using. The filter mentioned in the question made me realize that not only should I understand how it works, but I should also be able to design my own filters, depending on the input. Nice link, thank you! –  Iulian Şerbănoiu Sep 16 '11 at 13:57

My first reference that I found to be really helpful was The Scientist's and Engineer's Guide to Digital Signal Processing. I think it's strong suit is that it's geared toward getting the reader familiar with the concepts and terminology of DSP without getting too deep into the math. This tack fit my learning style and background as a Software Engineer with a light emphasis on EE. These days I always approach new topics in this way trying to understand the high-level concepts first and then dig deeper into the details with other information sources that are more detail/math-heavy.

share|improve this answer
    
That's what I started re-reading since it was the only thing I know containing references to a such topic. Thanks! –  Iulian Şerbănoiu Sep 19 '11 at 5:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.