Discretization of an RC Lowpass Filter

Over recent years Andy Simper has been posting novel digital audio filters derived from analog circuits using standard numerical techniques. I am a neophyte at numerical circuit modelling, so it was no surprise that I found some of Andy’s maths a bit terse and difficult to digest. In an effort to understand the basics I wrote up my own “pre-digested” version of the steps required to take an RC lowpass filter circuit and apply trapezoidal integration to generate the source code to model it (approximately).

You can read my article “Discretization of an RC Lowpass Filter” here [pdf].

Or go read Andy’s articles.

The source .tex file for my article is on github. Please feel free to post bugs, comments or corrections there, or send me an email.

Many thanks to Andy and the kind folks on #musicdsp for helping me through this.

2 Comments

  • 1
    November 16, 2018 - 11:31 pm | Permalink

    Thank you Ross for sharing your knowledge!

    I came across you by reading the author note of portaudio (great work!).

    I just would like to signal this paper about the digitalization of a 1st order RC filter, because it uses a really simple to understand math and approach:

    http://techteach.no/simview/lowpass_filter/doc/filter_algorithm.pdf

    I’ve used this model in many digital filters for low-entry embedded application with success.
    Particulary, choosing a = 1/(2^n) by playing with Ts (sampling time, denoted in the paper with ‘h’) and Tau (in the paper “Tf”), math operation will be reduced to an accumulation and a shift by n position for each Ts (each filtering cycle).

    Thank you again,
    Maurizio

  • 2
    November 17, 2018 - 9:13 pm | Permalink

    Thank you for sharing your knoledge!
    I came across you by discovering your great portaudio project. Thank you for this big effort!

    I would like to signal the approach documented by Finn Haugen ( http://techteach.no/simview/lowpass_filter/doc/filter_algorithm.pdf ) based on the (Euler) Backward Differentiation method.
    I used this algorithm with 8 bit microcontrollers too, in order to low-pass filter noisy signals in real application with success.
    In particular if you choose the filter parameters (equation 10 in the paper) such as a = 1/(2^n), the math behinf the filter reduces to an accumulation followed by one left shift by n position.

    Regards,
    Maurizio

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    14 − 4 =