Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been trying to figure out how to make IIR filters for a software modular synth, off and on for years now. (Basically, given parameters like cutoff frequency and dB per octave rolloff, how do I find the filter coefficients? There must be closed-form functions for this buried inside VCV Rack, Audacity, and LMMS somewhere, but the code is hard to follow. I don't know how all the Wikipedia articles and DSP guides manage to skip over this step, the only step I don't understand. Some of them even punt to "Call this Matlab function" or "Use this PHP page that generates C code for you" Bleh!)

I did encounter this book, but it still couldn't help me figure it out. I bookmarked it to try again.



First: cutoff, resonance, filter slope, etc., can be built with FIR (finite impulse response) filters. You can describe the passive circuit with a transfer function, which can be implemented in DSP using a z-transform. You can also describe a filter with poles and zeroes, and transform those. There's a bunch of resources on the web, e.g. https://ccrma.stanford.edu/~jos/filters/, but many assume you know something of electronics.

Recurrent filters don't have closed form solutions, and their implementation is a bit of an art. Plugin maker Urs Heckmann (from u-he.com) did a (rather successful) attempt at modeling the filter from an old synth with various implementations, and let people test them in the wild. He blogged about it, but I can't find all relevant posts. This might be a starting point: https://urs.silvrback.com/zero-delay-feedback

This course (https://www.staff.ncl.ac.uk/oliver.hinton/eee305/) is based on a book and links to the chapters, but there's a lot more (check the websites of MIT or Stanford's EE department for online courses).


These are the formulas you want:

https://webaudio.github.io/Audio-EQ-Cookbook/Audio-EQ-Cookbo...

They are the classic IIR biquads. If you want steeper filters, just run multiple equal filters in series (high-order IIRs are prone to numeric instability).

A more modern formatted version exists at e.g. https://www.w3.org/TR/audio-eq-cookbook/ .


I've had similar struggles. I found this comparison between Ableton's EQ Eight and Pro-Q by Dan Worrall [1] to be incredibly (and unexpectedly) informative on the subject. He is a very good teacher and an expert in the area. Maybe it might on your journey.

[1]: https://www.youtube.com/watch?v=ebBqP2PteAQ (be sure to watch from 15min+ onwards but the entire thing is a treat)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: